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

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


当前回答

下面这些步骤对我很有用:

cd [dir]
git init
git clone [your Repository Url]

我希望这对你也有用。

其他回答

我也面临着这个问题。解决它。 问题是网速很慢。请检查你的网络连接,别无其他。 我已经连接了良好的网速,然后它工作得很完美。希望对你有所帮助。

这个问题通常发生在克隆大型回购时。如果git克隆http://github.com/large-repository——depth 1在windows cmd上不起作用。尝试在windows powershell中运行该命令。

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

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

例如:

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

试试这个

$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com

https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup

这是我的工作。 capture.png