Loading

git_clone资源获取失败解决

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
posted @ 2019-02-04 15:51  素时听风  阅读(3667)  评论(0编辑  收藏  举报