我收到的错误如下: -
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
Run Code Online (Sandbox Code Playgroud)
git config --global http.postBuffer 524288000
git clone repo_url --depth 1
Run Code Online (Sandbox Code Playgroud)
我按照上面的步骤进行操作,最后我成功地克隆了我的代码。
看起来像是卷曲错误,通常是互联网连接速度过慢而关闭太早。
如此处所示,尝试浅克隆(或切换到ssh)
git clone https://ramweexcel@bitbucket.org/weexcel1/higher-education-haryana.g??it --depth 1
Run Code Online (Sandbox Code Playgroud)
即使那样,正如我在2011年所记录的那样,您可能仍需要提高http.postBuffer
git config --global http.postBuffer 524288000
Run Code Online (Sandbox Code Playgroud)
但是想法仍然存在:从一个提交深度开始可以有所帮助。
从那里,您可以逐渐增加深度:
git fetch --depth=<number-of-commits>
Run Code Online (Sandbox Code Playgroud)
并且,经过几次迭代:
git fetch --unshallow
Run Code Online (Sandbox Code Playgroud)
首先,尝试下载较小的数量,这样当网络出现故障时,您不必从零开始:
摘自ingyhere的这个答案
首先,关闭压缩:
Run Code Online (Sandbox Code Playgroud)git config --global core.compression 0接下来,让我们进行部分克隆以截断下来的信息量:
Run Code Online (Sandbox Code Playgroud)git clone --depth 1 <repo_URI>当它起作用时,进入新目录并检索克隆的其余部分:
Run Code Online (Sandbox Code Playgroud)git fetch --unshallow或者,或者,
Run Code Online (Sandbox Code Playgroud)git fetch --depth=2147483647现在,进行常规拉取:
Run Code Online (Sandbox Code Playgroud)git pull --all我认为 1.8.x 版本中的 msysgit 存在一个故障,会加剧这些症状,因此另一个选择是尝试使用早期版本的 git(我认为 <= 1.8.3)。
如果这没有帮助,因为您的网络仍然太不稳定或者您的存储库仍然太大,请尝试不同的网络 - 最好是有线网络。
对我来说,这不是一个选择。VonC 的答案指出要做git config --global http.postBuffer 524288000。如果您使用的是 https,也许您需要这样做git config --global https.postBuffer 524288000。
最后,最终对我有用的是:
放弃并使用另一台机器
如果它可以在您的笔记本电脑上运行,只需将该存储库拉到您的笔记本电脑上,然后运行
git bundle create /my/thumb/drive/myrepo.bundle --all
Run Code Online (Sandbox Code Playgroud)
并在你的另一台机器上恢复它
git clone /my/thumb/drive/myrepo.bundle
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2903 次 |
| 最近记录: |