我在 Windows 环境中使用 Linux 系统工作。为了使用 NT 代理服务器进行身份验证,我设置了 cntlm
并配置了系统程序以通过在 /etc/environment
中设置 http_proxy
环境变量来使用它文件。
现在我想删除此代理设置并让程序直接连接。
所以我取消了系统环境变量的设置:
unset http_proxy
unset HTTP_PROXY
检查 ~/.gitconfig
以确保没有代理条目。
明确指示 git
不要使用任何代理:
git config --global --unset http.proxy
git config --global --unset https.proxy
验证没有配置代理:
git config --system --get https.proxy
git config --global --get https.proxy
git config --system --get http.proxy
git config --global --get http.proxy
然后推送到远程仓库:
git push
但是 git
仍然尝试通过代理连接:
fatal: unable to access 'https://xxx@bitbucket.org/xxx.git/': Failed to connect to 127.0.0.1 port 3128: Connection refused
为什么它不释放 cntlm
?
最佳答案
最简单的检查是:
env|grep -i proxy
OP 确认:
I thought I had removed
proxy
by unsethttp_proxy
.
But there is a different environment variable for HTTPS which needs to be unset separately. Runningenv|grep -i proxy
revealed that.
关于git拒绝在没有代理的情况下连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30828237/