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

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


当前回答

几天后,今天我才解决了这个问题。按照本文生成ssh密钥:

https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

申报给

Git提供者(我正在使用的GitLab, GitHub)。 将此添加到本地标识。

然后通过命令克隆:

git clone username@mydomain.com:my_group/my_repository.git

没有错误发生。

上述问题

RPC失败;Curl 18传输关闭,读取数据出色 剩下的

因为通过HTTP协议克隆时出现错误(curl命令)。

并且,你应该增加缓冲区大小:

git config --global http.postBuffer 524288000

其他回答

你需要关闭压缩:

git config --global core.compression 0

然后你需要使用浅克隆

git clone --depth=1 <url>

然后最重要的步骤是CD到克隆的项目中

cd <shallow cloned project dir>

现在拆开克隆,一步一步

git fetch --depth=N, with increasing N

eg.

git fetch --depth=4

然后,

git fetch --depth=100

然后,

git fetch --depth=500

你可以通过替换N来选择你想要的步数,

最后下载所有剩下的版本,

git fetch --unshallow 

如果对你有帮助,请点赞:)

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

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

试试这个

$ 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

此问题出现在代理问题或网络缓慢时。你可以选择深度解决方案,或者

git fetch --all  or git clone 

    

如果给出curl 56 Recv失败的错误,则通过zip或下载文件 指定分支的名称,而不是——all

git fetch origin BranchName 

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

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

我希望这对你也有用。