git 设置代理
·
查看当前代理设置
git config --global http.proxy
git config --global https.proxy
设置当前代理为 http://127.0.0.1:7897
git config --global http.proxy http://127.0.0.1:7897
git config --global https.proxy https://127.0.0.1:7897
设置当前代理为 socket5://127.0.0.1:7897
git config --global http.proxy 'socks5://127.0.0.1:7897'
git config --global https.proxy 'socks5://127.0.0.1:7897'
删除代理
git config --global --unset http.proxy
git config --global --unset https.proxy
如果要取消代理修改:
git config --global --unset http.proxy
git config --global --unset https.proxy
上述方法挂了全局代理,但是如果要克隆码云、coding等国内仓库,速度就会很慢。更好的方法是只对github进行代理,不会影响国内仓库:
git config --global http.https://github.com.proxy http://127.0.0.1:7897
git config --global https.https://github.com.proxy https://127.0.0.1:7897
代理后速度如下:
![[图片]](https://i-blog.csdnimg.cn/blog_migrate/03cd7e9ceafc2857845c11323ea38979.png)
更多推荐
所有评论(0)