在Ubuntu下使用git clone 出现 error:RPC failed; curl 18 transfer closed with outstanding read data remainin

最近在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
  • 5
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值