【问题解决方案】git clone失败的分析和解决

参考链接

问题描述:

  • 无论是git clone还是pull,均失败,git clone大致是如下错误提示

remote: Counting objects: 5148, done.
remote: Compressing objects: 100% (16/16), 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限制了推送数据的大小导致的错误。

解决:

  • 方法1:增加git缓冲区大小

          git config --global http.postBuffer 524288000
          git config --list
  • 方法2:浅层克隆,深度设置为1

          git clone http://github.com/target.git --depth 1  # target.git 为目标地址
          cd target
          git fetch --unshallow
  • 解决:重新设置全局的通信缓存大小。

    git config --global http.postBuffer 524288000

  • 仍然报错时:

fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

猜你喜欢

转载自www.cnblogs.com/anliux/p/11668058.html
今日推荐