解决git pull/clone 问题 fatal: The remote end hung up unexpectedly

项目文件好几个月没有拉取,文件太多太大导致以下错误

fatal: early EOF: 90% (26964/29716), 1.00 GiB | 4.69 MiB/s
fatal: The remote end hung up unexpectedly
fatal: index-pack failed

 

尝试了以下方法都不行

$ git config --global http.lowSpeedLimit 0

$ git config --global http.lowSpeedTime 999999

$ git config --global http.postBuffer 5242880

 

在下面链接找到解决方法

https://stackoverflow.com/questions/21277806/fatal-early-eof-fatal-index-pack-failed

 

1. 如果有compression配置的话先关闭

   git config --global core.compression 0

2.  先做depth=1的 clone 

   git clone --depth 1 <repo_URI>

3.   git fetch --depth=100

后面再做 git pull --all

注意

如果第三步 做 git fetch --unshallow 会出错

$ git fetch --unshallow
remote: Enumerating objects: 28152, done.
error: RPC failed; result=18, HTTP code = 200
fatal: The remote end hung up unexpectedly
fatal: protocol error: bad pack header

posted @ 2021-09-24 10:46  guoguoxz  阅读(1599)  评论(0编辑  收藏  举报