Eclipse git和ssh-agent

Jan*_*ing 6 eclipse git egit ssh-agent

我使用eit和git(egit).

我想利用我的ssh-agent所以我可以从日食中推出.有谁知道如何设置egit使用ssh-agent?

背景:我无法将我的密钥上传到eclipse,因为我的密钥是在cryptostick上.我的ssh-agent可以在opensc的帮助下加载.

Jan*_*ing 7

在你的eclipse启动脚本或.profile(或任何地方)添加export GIT_SSH=/usr/bin/ssh之前启动eclipse.然后eclipse使用默认的ssh,它使用ssh代理,即使你的密钥在智能卡上,你也可以在eclipse中运行pull和push命令.

编辑:GIT_SSH由eclipse的egit解释,但也由独立的git解释.将其设置为/usr/bin/ssh将其设置为独立git的默认值,因此只有egit才会改变它的行为.


Von*_*onC 6

2016年6月更新(4年后):Gunnar Wagenknecht现在在评论中提及:

现在可以在带有项目,Eclipse ssh-agent和Pageant支持的Eclipse Neon中使用eclipseguru/eclipse-jsch-agent-proxy

https://raw.githubusercontent.com/eclipseguru/eclipse-jsch-agent-proxy/gh-pages/images/ssh-agent-preferences.png


较早的Eclipse版本的一种解决方法是通过设置GIT_SSH环境变量来使用本机OS SSH客户端而不是Eclipse内置客户端:

export GIT_SSH=/usr/bin/ssh
Run Code Online (Sandbox Code Playgroud)

(请参阅EGit SSH配置EGit FAQ,SSH配置