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配置页面。

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

gitlab添加ssh key

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

保存,完成,再次通过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

上一篇:PHP销毁变量-unset()函数


下一篇:Pyhon基础知识之Json序列化与反序列化