Git第四阶段:bit project clone / 速度太慢

1.error when clone big project:

error: RPC failed; curl transfer closed

do a shallow clone first:

git clone https://github.com/qt/qt5.git --depth 1

update the repository:

cd qt5
git fetch --unshallow

2. 解决速度太慢的问题

大工程报错的一个原因,是下载速度太慢,而掉线。所以解决clone速度慢,也是方案之一。

网上搜集的方案一,更改缓冲区:

git config --global http.postBuffer 524288000

网上搜集的方案二,变更host:

linux在/etc/hosts文件里追加:
windows在C:\Windows\System32\drivers\etc\hosts里追加:
52.74.223.119 github.com
185.199.110.153 developer.github.com
185.199.109.153 assets-cdn.github.com
151.101.197.194 github.global.ssl.fastly.net

如果是windows的,要ipconfig /flushdns 刷新dns。

网上搜集的方案三,优化代理:

如果你有科学上网的话,指定你当前代理的软件接口:
指定代理参考:
git config --global http.https://github.com.proxy socks5://127.0.0.1:1086
git config --global https.https://github.com.proxy socks5://127.0.0.1:1086
清除代理参考:
git config --global --unset http.proxy
git config --global --unset https.proxy

参考文章:
https://www.jianshu.com/p/0493dcc15d6f

发布了43 篇原创文章 · 获赞 2 · 访问量 3384

猜你喜欢

转载自blog.csdn.net/songpeng26/article/details/104999088