切记先打开代理!!!!!!!
在cmd中输入以下指令:
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080
(端口号看你自己的配置,一般都是1080)
如果要取消代理修改:
git config --global --unset http.proxy
git config --global --unset https.proxy
上述方法挂了全局代理,但是如果要克隆码云、coding等国内仓库,速度就会很慢。更好的方法是只对github进行代理,不会影响国内仓库:
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
git config --global https.https://github.com.proxy socks5://127.0.0.1:1080
本文详细介绍了如何在Git中设置代理,以加速与GitHub的连接,同时提供了取消代理及仅对GitHub使用代理的方法,避免影响国内仓库的速度。

889

被折叠的 条评论
为什么被折叠?



