当我试图从GitLab (GitLab 6.6.2 4ef8369)克隆一个存储库时,我遇到了这个错误:

remote: Counting objects: 66352, done.
remote: Compressing objects: 100% (10417/10417), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

然后中止克隆。我该如何避免这种情况?


当前回答

我能够克隆与GitHub桌面回购

其他回答

简单的解决方案:与其通过https克隆,不如通过ssh克隆。

例如:

git clone https://github.com/vaibhavjain2/xxx.git - Avoid
git clone git@github.com:vaibhavjain2/xxx.git - Correct

这种情况经常发生,我的网络连接很慢,我不得不克隆一个相当大的git存储库。最常见的问题是连接关闭,整个克隆被取消。

Cloning into 'large-repository'...
remote: Counting objects: 20248, done.
remote: Compressing objects: 100% (10204/10204), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining 
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

经过大量的尝试和错误,以及大量的“远程端意外挂断”之后,我有了一个适合我的方法。这个想法是先做一个浅克隆,然后用它的历史更新存储库。

$ git clone http://github.com/large-repository --depth 1
$ cd large-repository
$ git fetch --unshallow

网络连接问题。 可能是由于持久连接超时。 最好的办法是换一个网络。

可能有两个原因

网速很慢(这是我的情况) 缓冲区大小较小,在这种情况下可以运行命令 Git配置——global http。postBuffer 524288000

对我来说,工作的是,因为这个错误可能发生在git的内存需求。我已经将这些行添加到我的全局git配置文件。gitconfig中,该文件位于$USER_HOME中,即C:\Users\<USER_NAME>\.gitconfig

[core] 
packedGitLimit = 512m 
packedGitWindowSize = 512m 
[pack] 
deltaCacheSize = 2047m 
packSizeLimit = 2047m 
windowMemory = 2047m