github上克隆一个仓库到本地,一直失败。还以为是git安装问题,卸载重装无效;又换了个大容量的磁盘目录位置;最后ECS系统也重装还是无效。。

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

然后google了下(为什么我不一开始就搜索。。。想当然瞎折腾)

原因是要克隆的仓库太大,文件多,导致git clone失败。

解决:

  • 方法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

相关文章:

  • 2021-11-10
  • 2022-01-18
  • 2021-12-08
  • 2022-12-23
  • 2021-05-21
  • 2021-12-09
  • 2022-12-23
猜你喜欢
  • 2021-10-16
  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-13
相关资源
相似解决方案