赞
踩
下载自己github上的项目,结果因为太慢,失败了好几次,以为公司网络问题,回到住所后下载也出现了这个问题,这就没法忍了,于是上网查了下,特此记录下。
git clone时报RPC failed; curl 18 transfer closed with outstanding read data remaining 错误
原因1:缓存区溢出。curl的postBuffer的默认值太小,我们需要调整它的大小,在终端重新配置大小在这里,笔者把postBuffer的值配置成500M
解决方法:命令行输入
git config http.postBuffer 524288000
执行上面命令要在git安装目录下,如果配置报错fatal: not in a git directory那就放弃吧,可能版本不支持。
如果配置成功依旧clone失败,考虑可能原因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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。