git拒绝在没有代理的情况下连接

标签 git proxy

我在 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 unset http_proxy.
But there is a different environment variable for HTTPS which needs to be unset separately. Running env|grep -i proxy revealed that.

关于git拒绝在没有代理的情况下连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30828237/

相关文章:

git - 如何使该脚本反射(reflect) PS1 上的分支状态?

Mojave 上的 Git 命令问题

proxy - 如何从另一个代理后面为 JMeter 设置代理?

Nginx 使用gunicorn 和 python-socketio 进行反向代理

node.js - APache2 反向代理背后的 NodeJS 应用程序在上传文件时出现错误 "413 Request Entity Too Large"

http - CORS 使用带有 ARR 和 URL 重写的 IIS 作为反向代理

git - 设置 git 和 ssh 并使用 ssh-agent 在 Windows 上使用 msysgit 存储密码

git - 删除 git-lfs

linux - Git pull 权限被拒绝 linux?

ssh - SSH 的 MobaXterm SOCKS5 代理