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

其他回答

如上所述,首先从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克隆http://github.com/large-repository——depth 1在windows cmd上不起作用。尝试在windows powershell中运行该命令。

我能够克隆与GitHub桌面回购

你需要关闭压缩:

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 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