git中设置代理
说明:在某种原因下,整个网络都是使用代理的情况下,需要使用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,成功下载
GitHub:For A Better Future
CSDN:不负天地,不负自己!
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须在文章页面给出原文连接,否则保留追究法律责任的权利。
郑重声明:本站资料整理自个人gqzdev或者互联网,用于Java学习者交流学习使用,对资料版权不负任何法律责任,若有侵权请及时联系屏蔽删除