解决git clone太慢的问题

该问题出现的原因大家都懂。
主要解决的方法有两种,一种是更改host但是个人觉得效果不好。
另外一种是设置代理,这个前提是你使用了酸酸乳代理。
这种情况下使用以下命令即可,注意1080是端口,这个需要打开代理软件才知道,windows和ubuntu一般是1080,mac可能是1086

git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080

或者打开文件sudo gedit .gitconfig,没有就创建一个,复制以下内容,

[https "https://github.com"]
	proxy = https://127.0.0.1:1080
[http "https://github.com"]
	proxy = socks5://127.0.0.1:1080

即可,这个效果跟上面一样。

参考链接

发布了95 篇原创文章 · 获赞 30 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/JohnJim0/article/details/105228842