git代理
[问题描述和现象]
git clone时报如下错误:
fatal: unbale to access `....` : The requested URL returned error: 502
[原因分析]
需要去掉代理下载代码
添加代理
如果你开启了VPN,很可能是因为代理的问题,这时候设置一下http.proxy就可以了。
一定要查看自己的VPN端口号,假如你的端口号是7890,在git bash命令行中输入以下命令即可:
git config --global http.proxy 127.0.0.1:7890
git config --global https.proxy 127.0.0.1:7890
取消代理
如果你之前git中已经设置过上述配置,则使用如下命令取消再进行配置即可:
git config --global --unset http.proxy
git config --global --unset https.proxy
下面是几个常用的git配置查看命令:
git config --global http.proxy #查看git的http代理配置
git config --global https.proxy #查看git的https代理配置
git config --global -l #查看git的所有配置
参考
https://blog.csdn.net/qq_37555071/article/details/114260533