git clone时报RPC failed; curl 18 transfer closed with outstanding read data remain

387 阅读1分钟

git clone时,文件较大,网速相比较慢

缓存区溢出 命令行输入

git config http.postBuffer 524288000

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

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

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

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

后续:git clone --depth=1 git地址 本地仓库无法获取远程分支,修改.git/config 文件,把 fetch 改成下面第二种形式,不要写死master。

[remote "origin"]
        url = https://github.com/xxx/project.git
        fetch = +refs/heads/master:refs/remotes/origin/master

改为

[remote "origin"]
        url = https://github.com/xxx/project.git
        fetch = +refs/heads/*:refs/remotes/origin/*

重新git pull 就可以获得远程分支了