当我试图从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

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


当前回答

这个问题100%解决了。我正面临这个问题,我的项目经理改变了回购的名称,但我使用旧的回购名称。

Engineer@-Engi64 /g/xampp/htdocs/hospitality
$ git clone https://git-codecommit.us-east-2.amazonaws.com/v1/repo/cms
Cloning into 'cms'...
remote: Counting objects: 10647, done.
error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

我是如何解决这个问题的。回购链接是无效的,所以这就是为什么我面临这个问题。克隆前请检查您的回购链接。

其他回答

当我尝试从远程克隆时,反复出现同样的问题:

remote: Counting objects: 182, done.
remote: Compressing objects: 100% (149/149), 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 https://username@bitbucket.org/repositoryName.git --depth 1

对我来说,问题是在整个克隆完成之前连接就关闭了。我用的是以太网而不是wifi连接。这对我来说就解决了

在更改为HTTP/1.1后,我在做git推送时遇到了这个错误。

解决方案:关闭我的VPN,重新运行git push。

这种情况经常发生,我的网络连接很慢,我不得不克隆一个相当大的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 clone --global core.compression 0

then

git clone --depth=1 <https://your_repo.git>

then

git fetch --depth=2

then

git fetch --depth=10

... 等等,直到他写到

remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0

最后你可以写

git fetch --unshallow

你会被扔出去

fatal: --unshallow on a complete repository does not make sense

如果在某个阶段再次得到错误,请尝试将——depth属性设置为较小的值并逐渐进一步增加