git中设置代理

↘锁芯ラ 提交于 2019-12-04 20:23:31

  说明:在某种原因下,整个网络都是使用代理的情况下,需要使用git clone,这时就需要设置代理了。

  在没有设置代理的时候,直接克隆报错  Failed to connect to gitee.com port 443: Connection refused

 

   在git中设置proxy

 

    设置Socks5代理

 

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

 

 

 

    设置http/https代理

 

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

 

 

 

    取消代理

 

git config --global --unset http.proxy 
git config --global --unset https.proxy

 

 

    再次git clone,成功下载

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!