当前位置:   article > 正文

【git】RPC failed;curl 18 transfer closed with outstanding read data remaining [已解决]_error: rpc failed; curl 18 transfer closed with ou

error: rpc failed; curl 18 transfer closed with outstanding read data remain

问题

最近clone公司工程总是遇到以下问题

git clone https://git.xxxxxxxxx
Cloning into 'XXXX-Android'...
remote: Enumerating objects: 5415, done.
remote: Counting objects: 100% (5415/5415), done.
remote: Compressing objects: 100% (614/614), 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
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

原因

根据网上信息来看,主要有以下几个问题:

  1. 缓存不够大
  2. 文件过多,包括提交记录过多
  3. 网络问题

解决

增大缓存

针对缓存问题,也是网上提及最多的,也就是配置以下内容:

git config --global http.postBuffer 524288000
  • 1

一般介绍是设置为500M,我直接多加了个0,设置为5G,但还是存在报错

文件/提交记录过多

没有找到原理性原因,只是尝试约束了几个参数,就成功了

git clone -b master https://git.xxxxxxxxxxxx --depth 1
  • 1
  1. -b master为只拉取主分支内容,可以将master改为其他分支名称
  2. --depth 1为只拉取最近一次提交的内容

btw:只设置了-b master之后,错误信息减少了,所以进一步设置了depth,还需要深挖原因。

git clone -b master https://git.xxxxxxxxxxxxx
Cloning into 'xxxxxx-Android'...
remote: Enumerating objects: 5415, done.
remote: Counting objects: 100% (5415/5415), done.
remote: Compressing objects: 100% (614/614), done.
fatal: the remote end hung up unexpectedly23 MiB | 1.14 MiB/s
fatal: index-pack failed
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

网络问题

该上梯子上梯子,该进内网进内网,网络稳定了,成绩才好,不管是工作还是游戏。。。。

换协议

参考:刘大侠GG_B的error: RPC failed; curl 18 transfer closed with outstanding read data remaining的解决
clone 方式换成SSH的方式,即 https 改为 git
例如

git clone https://github.com/flutter/flutter.git
  • 1

换成

git clone git://github.com/flutter/flutter.git
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/707502
推荐阅读
相关标签
  

闽ICP备14008679号