智能摘要 DeepSeek
本文介绍了如何查询、取消和重新设置代理端口。首先通过命令查询代理设置,若存在则取消系统及Git的代理配置,并清除相关环境变量。取消后再次查询确认,若无代理则重新设置Git的HTTP/HTTPS代理端口,推荐使用SOCKS5代理。
查询下代理,如果有,就取消。然后重新设置代理端口即可。
1、查询代理
env|grep -i proxy
2、有
通过系统命令取消代理
unset http_proxy
unset https_proxy
unset all_proxy
通过git取消代理设置
git config --global --unset http.proxy
git config --global --unset https.proxy
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
npm config delete proxy
#只对github.com
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
#取消代理
git config --global --unset http.https://github.com.proxy
3、再次查询
git config --global http.proxy #查看git的http代理配置
git config --global https.proxy #查看git的https代理配置
git config --global -l #查看git的所有配置
4、如果没有就重新设置代理端口
git config --global http.proxy 127.0.0.1:1087
git config --global https.proxy 127.0.0.1:1087
#使用socks5代理(推荐)
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
#使用http代理(不推荐)
git config --global http.https://github.com.proxy http://127.0.0.1:1080
评论