社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
使用git bash 从github clone代码时遇到下面的错误
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
因为curl的postBuffer的默认值太小,导致溢出。(git 的 HTTP 底层是通过 curl 的。HTTP 底层基于 TCP,而 TCP 协议的实现是有缓冲区的)
说明git 仓库源文件过多,或者clone的一些文件过大。
git config --global http.postBuffer 524288000
设置完后,用下面命令检查,git config --list
会多一行上面的配置信息http.postbuffer=524288000
git clone https://...git --depth 1
然后
git fetch --unshallow
也有可能是网络下载速度缓慢导致的
https://www.ipaddress.com/
向下滑动,就可以找到下面的信息:Top Sites中有我们要查找的信息
输入 github.global.ssl.fastly.net和github.com,或者通过点击上面的链接;
从网站中信息中查找 IPv4 Addresses 信息,即ip 信息。
打开路径:C:WindowsSystem32driversetc
修改 hosts 文件
例如,添加下面2行:
199.232.5.x github.global.ssl.fastly.net
192.30.253.x github.com
上面的ip地址,根据查到的真实ip地址进行配置。
打开cmd,执行下面的命令行:
ipconfig /flushdns
再次测试,速度应该得到提升。
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!