github上克隆一个仓库到本地,一直失败,就是下载不下来。
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 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