当我尝试从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
然后克隆被中止。如何避免这种情况?

最佳答案

它经常发生,我的网络连接速度很慢,我必须克隆一个不错的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

08-26 22:01