2013-02-14 126 views
0

我無法從Windows(DOS)命令提示符,但從bash它的工作推送到github。推送到Github在Windows下失敗

如果我跑git push origin master我:

Permission denied (publickey). 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists. 

如果我跑ssh-add我:

Could not open a connection to your authentication agent. 

一切都工作得很好bash下(msysgit) - 怎麼會這樣?

回答

0

解決方案是要認識到ssh(在windows下)正在尋找我的%USEPROFILE%\.ssh文件夾中名爲id_rsa的文件,但其中的文件名爲github_rsa

解決方案:

rename %USERPROFILE%\.ssh\github_rsa id_rsa 
rename %USERPROFILE%\.ssh\github_rsa.pub id_rsa.pub 

變戲法似的,推,拉,現在工作沒有進入舞會!

可能的解釋:以前安裝的github for windows生成了github_rsa文件。

奇怪的是,在重命名後git push仍然在bash下工作!