最近在ubuntu中下载一些项目,由于公司网络限速,下载速度只有羞耻的9KiB/s,真是一言难尽啊;碰到了如下问题:
remote: Enumerating objects: 147, done.
remote: Counting objects: 100% (147/147), done.
remote: Compressing objects: 100% (117/117), 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
赶紧网上查找解决方案:
1 缓存区溢出 curl的postBuffer的默认值太小
在这里,按照查到的资料把postBuffer的值配置成1G之多;
git config --global http.postBuffer 1073741824
这样已经配置好了,可以命令查看postBuffer 来确认设置是否成功。
git config --list
其实我下载的内容根本没有那么大,所以这么操作毫无作用;
2 网络下载速度缓慢, 这才是符合实际的可能因素,可惜一开始习惯了慢网速,也没有觉得;
解决方法:输入命令行
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999
果然顺利的解决,心情顿时愉悦;
也就没有用到第三种解决办法:
如果依旧clone失败,则首先浅层clone,然后更新远程库到本地
git clone --depth=1 http://gitlab.xxx.cn/yyy/zzz.git
git fetch --unshallow