解决git clone速度慢问题
修改hosts
该方法亲测无效,不过很多博客里都提到过
通过https://www.ipaddress.com/ 搜索
github.global.ssl.fastly.net
github.com
的ip地址并加入hosts文件如下
其中Linux中hosts文件路径为/etc/hosts
192.30.253.112 github.com
151.101.44.249 github.global.ssl.fastly.net
保存更新DNS缓存
sudo /etc/init.d/networking restart
改用国内仓库
注册登陆 码云
在右上角“+”中选择“从Github/GitLab中导入仓库”
然后填入https地址即可
导入成功后可以直接clone码云中的地址
使用代理
最简单粗暴的方法(前提需要有梯子)
设置代理
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080
git config --global http.sslVerify false
这里假设本地socks5代理端口为1080
取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy