1

我最近将 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
...

我可以使用相同的密钥从 linux 机器通过 ssh 推送到 repo。我也可以使用 OpenSSH(来自 Windows)通过 ssh 连接到主机,但也无法设置它以便 git 正确使用它。

为什么 git 会失败?

4

1 回答 1

1

经过一番汗水和摆弄后,我发现 git 提供了以下功能:(a)将密钥加载到 Pageant 中,并且(b)从远程 url 中删除了 ssh:// 前缀。

(b) 和我开始摆弄之前一样;然而,(a) 从未被要求。我可能会想办法避免它,但我现在太高兴了,不想打扰;)。

于 2013-10-01T20:04:36.223 回答