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

其他回答

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

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

我希望这对你也有用。

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

对我来说,工作的是,因为这个错误可能发生在git的内存需求。我已经将这些行添加到我的全局git配置文件。gitconfig中,该文件位于$USER_HOME中,即C:\Users\<USER_NAME>\.gitconfig

[core] 
packedGitLimit = 512m 
packedGitWindowSize = 512m 
[pack] 
deltaCacheSize = 2047m 
packSizeLimit = 2047m 
windowMemory = 2047m

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

缓慢的互联网。

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

服务器端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 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