7

我一直试图让 gitHub 和 Egit 合作,但没有成功。我安装了 github 的软件包并以这种方式制作了一个 SSH 密钥,但 Egit 没有提示我输入密码,它给了我这个错误:

Cannot get remote repository refs.
Reason: ssh://git@github.com:22: passphrase for C:\Documents and Settings\User\.ssh\id_rsa

我在推送菜单中有这些设置:

URI: ssh://git@github.com/YoungMaker/<projectName>.git
host: github.com
Repository path: /YoungMaker/<projectName>.git
protocol: SSH
port <BLANK>
User: git
password <blank>

我还尝试了 GIT_SSH 环境变量,并将其设置为 C:\Documents and Settings\User.ssh,以及 plink.exe(我不知道那是什么(显然是一些 .exe))

尝试从 gitHub GUI 推送后,出现此错误。这很奇怪,因为我有 C:\Documents and Settings\User.ssh 目录,其中包含一个配置文件和一个 id_rsa 键。

Pushing to git@github.com:YoungMaker/GitTester.git
error: cannot spawn C:\Documents and Settings\User\.ssh: No such file or directory
fatal: unable to fork
4

2 回答 2

6

Old question, but for future reference:

Make sure you did setup a push remote. It worked for me when I got both the Cannot get remote repository refs-problems ("... Passphrase for..." and "Auth fail" in the "Push..." dialog).

Provided that you already:

  1. Setup your SSH keys with Github (Window > Preferences > General > Network Connections > SSH2)

  2. Setup your local repository (you can follow this guide for that)

  3. Created a Github repository (same guide)

... here's how you do it:

  • Go to the Git Repositories view (Window > Show View > Other > Git Repositories)
  • Expand your Repository and right click Remotes --> "Create Remote"
  • "Remote Name": origin, "Configure push": checked --> click "OK"
  • Click the "Change..." button
  • Paste your git URI and select protocol ssh --> click "Finish"
  • Now, click "Save and Push" and NOW you should get a password prompt --> enter the public key passphrase here (provided that you DID (and you should) setup a passphrase to your public key) --> click "OK"
  • Now you should get a confirmation window saying "Pushed to YourRepository - origin" --> click "OK"
  • Push to upstream, but this time use "Configured remote repository" as your Destination Git repository
  • Go get yourself a well earned cup of coffee!
于 2013-09-01T20:55:39.530 回答
2

如果您创建了一个受其保护的私钥,则需要该密码,如“ GitHub:SSH 密钥密码”中所述。
但这意味着您需要一个 SSH 代理来为您提供该密码。

如果 Egit 在推送时没有提示输入,这可能意味着:

  • 您的 SSH 密钥未受密码保护
  • 您的 SSH 密钥无法以某种方式访问​​(路径错误,或该路径上的保护错误)

另请参阅Vogella 的教程

egit ssh uri

于 2012-04-22T01:01:36.050 回答