在进行git clone时,遇到了一系列问题,记录下来方便以后查看
我在树莓派TensorFlow+opencv项目时进行了一条git clone命令,出现了各种各样的错误
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
出现该问题时,网上给出的方案无非三种
一,加大缓存区
git config --global http.postBuffer 524288000
这个大约是500M
git config --list查看
二、少clone一些,–depth 1
git clone https://github.com/flutter/flutter.git --depth 1
–depth 1的含义是复制深度为1,就是每个文件只取最近一次提交,不是整个历史版本。
三、换协议
clone http方式换成SSH的方式,即 https:// 改为 git://
例如git clone https://github.com/flutter/flutter.git
换成git clone git://github.com/flutter/flutter.git
(以上内容来自https://blog.csdn.net/hdfqq188816190/article/details/97403508)
第一种我尝试加500M,加5G,仍然失败
第二种,加上以后下载进度多了一些,但仍然没有解决问题
第三种同样。
此外 还查到有如下原因
网络下载速度 缓慢(这个的确,速度平均10K左右 )
解决方法:命令行输入
git config --global http.lowSpeedLimit 0git config --global http.lowSpeedTime 999999
仍然报错
随后不知为何出现error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received.这一错误(忘了。。。貌似是使用上面的方法三)
error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received.
采取如下两种方案
3、压缩配置
git config --global core.compression -1
4、修改配置文件
export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1
依旧不行
最后解决:
git config --global pack.windowMemory “100m”
git config --global pack.SizeLimit “100m”
git config --global pack.threads “1”
git config --global pack.window “0”
使用两次GIT,终于在凌晨做好了