延續問題here的: 我試圖建立在GitHub上我的第一個Git倉庫。 (注意,這意味着我不能使用膩子,我使用的是openssh,或者至少我應該和我認爲我是)。我一直在關注GitHub的網站here上的文檔。直到最後一條命令:git push -u origin master
,我纔得到一切。它給了我下面的錯誤:的Git服務器的主機密鑰 - GitHub.com
The server's host key is not cached in the registry.
You have no guarantee that the server is the computer you think it is.
The server's rsa2 key fingerprint is: ssh-rsa 2048
16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
Connection abandoned. fatal: The remote end hung up unexpectedly
我猜這意味着我的known_hosts
文件的SSH-RSA密鑰沒有找到,但我不知道如何解決這個問題。我試過ssh -T [email protected]
,我登錄就好了。我也嘗試關閉git bash並重新打開以防萬一它是緩存問題。這不能解決問題。這是我得到的與文檔指出的唯一不同的輸出。我希望建立一個可愛的Java助手庫,所以任何幫助將不勝感激!
奇怪......就像http://stackoverflow.com/questions/10156356/github-the-remote-end-hung-up-unexpectedly/10156776#comment13041705_10156776。同樣的問題:'$ HOME/ssh/known_hosts'存在嗎? '$ HOME'(或'git-cmd.bat' DOS會話中的'%HOME%')是否已經定義好了? (如http://stackoverflow.com/questions/10122439/msysgit-and-ssh-config-missing/10122865#10122865) – VonC 2012-04-15 21:33:50
爲什麼你認爲你不能膩子?你確定ssh-agent正在運行嗎?我已經使用Plink.exe和ssh.exe連接到Github。如果可以,請發佈您的.git/config。 – 2012-04-15 21:34:56
另外,你碰巧有GIT_SSH環境變量集嗎? – 2012-04-15 21:44:02