最近,我将git升级到1.8.4.msysgit.0 (在Windows 7上),从那以后,我就再也无法推出多年来一直使用的回购工具。(注:我也将长期使用的1.7.0.2降级,但这也无济于事。)
我得到这个是为了一个简单的git push
Using username "git-receive-pack 'git-myname".
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.这个奇怪的用户名是什么?
对于git clone (...git-upload-pack...),我也得到了类似的消息。注意:我可以通过https克隆。
SSH本身似乎对PuTTY的plink没问题
C:\test>set GIT_SSH
GIT_SSH=C:\Program Files\PuTTY\plink.exe
C:\test>git remote -v
origin ssh://git-myname@free1.projectlocker.com:myrepo.git (fetch)
origin ssh://git-myname@free1.projectlocker.com:myrepo.git (push)
C:\test>"C:\Program Files\PuTTY\plink.exe" -v git-myname@free1.projectlocker.com -i mykey.ppk
Looking up host "free1.projectlocker.com"
...
Using SSH protocol version 2
...
Reading private key file ".\mykey.ppk"
Using username "git-myname".
Offered public key
...
Offer of public key accepted
...
Access granted
Opened channel for session
...我可以使用相同的键通过ssh从linux盒中推送到repo。我也可以使用OpenSSH (从Windows)对主机进行ssh,但也不能设置它,以便git正确地使用它。
为什么git失败?
发布于 2013-10-01 20:04:36
经过相当多的努力和周旋之后,我发现git工作的条件是:(a)键被加载到Pageant中,(b) ssh://前缀从远程url中删除。
(b)与我开始四处兜风之前的情况相同;(a)但从来不需要。我可能会想办法避开它,但我现在太高兴了,不想麻烦了;)
https://stackoverflow.com/questions/19124050
复制相似问题