git pull和fetch失败,错误信息为“fatal: The remote end hung up unexpectedly”

3

我正在使用cygwin git在Win7上,尝试与我的linux工作站协调。两者都是从同一个上游存储库克隆而来的。首先我执行“git fetch origin”,然后尝试从我的工作站获取。

$ git fetch origin
[... all ok ...]
$ git fetch b
scheib@b's password:
remote: Counting objects: 2031, done.
remote: Compressing objects: 100% (512/512), done.
fatal: The remote end hung up unexpectedly
fatal: early EOFs:  23% (182/789)
fatal: index-pack failed

这个链接是否有帮助?(包括使用 msysgit 而不是 cygwin git?) http://stackoverflow.com/questions/3750222/cygwin-git-clone-gives-remote-end-hung-up-unexpectedly-against-ubuntu-10-04-1 - VonC
我通过使用msysgit和ssh协议来解决了这个问题。 - Vincent Scheib
2个回答

0

Cygwin的ssh.exe存在这个bug。用msysgit安装中的ssh.exe替换cygwin的ssh.exe,这个问题就会消失。

相关链接:Git fatal: remote end hung up


Stack Overflow使用的是问答格式,而不是线程对话格式。每个“答案”都应该是一个答案。 - dmckee --- ex-moderator kitten
是的,很好。此外,看了编辑历史记录,我可能一开始太严厉了。对此感到抱歉。 - dmckee --- ex-moderator kitten

-1

你是如何创建你的密钥的?

使用cygwin的git还是在git bash中使用mingw的git?

我认为真正的问题是cygwin的ssh在/home/name/.ssh中查找.ssh,而mingw的git ssh在c:/user/name/.ssh中查找.ssh。

很有可能你的密钥只存在于这两个目录中的一个。

你可以尝试使用-i开关告诉cygwin的.ssh使用不同的身份文件,或将密钥移动到这两个目录中的一个,或在/home/name/.ssh/config中创建一个ssh配置文件。

我创建了一个包含以下内容的配置文件:

Host github.com
    User jerryasher
    Hostname github.com
    IdentityFile c:/Users/jerry/.ssh/id_rsa

鉴于我可以使用来自Git Bash的Mingw Git或来自rxvt的Cygwin Git与GitHub进行交互。


如果密钥有问题,它就无法连接。 - Edward Anderson

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接