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

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

其他回答

如上所述,首先从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 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 

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

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

git fetch --all  or git clone 

    

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

git fetch origin BranchName 

这种情况的发生通常是由于以下原因之一:

缓慢的互联网。

切换到网络连接稳定的局域网电缆在很多情况下都有帮助。在获取时避免执行任何并行网络密集型任务。

服务器端TCP/IP连接超时。

你也无能为力。您所能做的就是请求系统管理员或CI/CD团队增加etcp /IP超时时间并等待。

服务器负载过重。

由于工作时间服务器负载过重,下载大文件可能会不断失败。晚上开始下载后离开你的机器。

客户端机器上的小HTTPS缓冲区。

增加post和request的缓冲区大小可能会有所帮助,但不能保证

Git配置——global http。postBuffer 524288000 Git配置——global http。maxRequestBuffer 524288000 Git配置——global core.compression 0

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