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
来源: http://www.bubuko.com/infodetail-2944821.html