参考链接:https://git-scm.com/book/zh/v2/%E8%87%AA%E5%AE%9A%E4%B9%89-Git-%E9%85%8D%E7%BD%AE-Git
命令行模式下配置
git config --global https.proxy https://proxyuser:proxypassword@ip/域名:port
git config --global http.proxy http://proxyuser:proxypassword@ip/域名:port
假设某人在百度工作,公司代理服务器是(proxy.baidu.com),端口是(8080),代理配置如下
1、代理服务器需要鉴权配置
git config --global https.proxy https://username:password@proxy.baidu.com:8080
2、代理服务器不需要鉴权配置
git config --global https.proxy https://proxy.baidu.com:8080
3. 查看代理
git config --global http.proxy git config --global https.proxy
4. 设置代理
git config --global https.proxy [http://127.0.0.1:1080]
5. 取消代理
git config --global --unset http.proxy git config --global --unset https.proxy