git clone error:RPC failed; curl 18 transfer closed with outstanding read data remaining

Posted yizhilin

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了git clone error:RPC failed; curl 18 transfer closed with outstanding read data remaining相关的知识,希望对你有一定的参考价值。

git clone时报RPC failed; curl 18 transfer closed with outstanding read data remaining 错误

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的默认值太小,我们需要调整它的大小,在终端重新配置大小

解决方法:命令行输入

git config --global http.postBuffer 924288000

这里我们把postBuffer的值配置成900M。可以根据自己需要下载的文件大小,将postBuffer值配置成合适的大小。

可以根据以下命令查看postBuffer

git config --list

2,执行上面命令如果依旧clone失败,考虑可能原因2:网络下载速度缓慢

解决方法:命令行输入

git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999

3,如果依旧clone失败,则首先浅层clone,然后更新远程库到本地

git clone --depth=1 http://gitlab.xxx.cn/yyy/zzz.git
git fetch --unshallow

4,使用ssh进行拉取

生成本地ssh公钥:

ssh-keygen -t rsa -C "pannn@xxx.com.cn"

一路回车即可;进入指定位置打开公钥文件,打开复制内容粘贴到gitlab的ssh配置页面。

技术图片

技术图片

gitlab添加ssh key

技术图片

保存,完成,再次通过git bash窗口clone项目即可

git clone git@192.168.1.100:xxx/xxxxx.git

 

 

参考:https://www.cnblogs.com/zjfjava/p/10392150.html

 

以上是关于git clone error:RPC failed; curl 18 transfer closed with outstanding read data remaining的主要内容,如果未能解决你的问题,请参考以下文章

使用git clone命令报错:error: RPC failed; curl 18 transfer closed with outstanding read data remaining(示例代码

使用git clone命令克隆文件出现error: RPC failed; curl 18 transfer closed with outstanding read data remaining问题

error: RPC failed; curl 18 transfer closed with outstanding read data remaining的解决

sourcetree拉取代码出错 error: RPC failed; curl 18 transfer closed with outstanding read data remaining(示例代

git push报错:error: RPC failed; result=22, HTTP code = 413

git error: RPC failed; curl transfer closed with outstanding read data remaining