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

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


当前回答

如上所述,首先从bash运行git命令,在开始时添加增强的日志指令:GIT_TRACE=1 GIT_CURL_VERBOSE=1 git…

例如:GIT_CURL_VERBOSE=1 GIT_TRACE=1 git -c diff.mnemonicprefix=false -c core。Quotepath =错误的获取源 这将显示详细的错误信息。

其他回答

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属性设置为较小的值并逐渐进一步增加

几天后,今天我才解决了这个问题。按照本文生成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 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

对我来说,这个问题是因为代理配置。我在代理例外中添加了ip git服务器。 git服务器是本地的,但是no_proxy环境变量设置不正确。

我使用这个命令来识别问题:

#Linux:
export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1

#Windows
set GIT_TRACE_PACKET=1
set GIT_TRACE=1
set GIT_CURL_VERBOSE=1

作为回报,有“代理授权”,因为git服务器不应该通过代理。 但真正的问题是代理规则定义的文件大小

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