git拒绝没有代理的连接 [英] git refuses to connect without proxy

查看:72
本文介绍了git拒绝没有代理的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows环境中的Linux系统上工作.要使用NT代理服务器进行身份验证,我已设置cntlm并配置了系统程序以通过在/etc/environment文件中设置http_proxy环境变量来使用它.

I work on a Linux system in a Windows environment. To authenticate with a NT proxy server I had setup cntlm and configured system programs to use it via setting http_proxy environment variable in the /etc/environment file.

现在我要删除此代理设置并让程序直接连接.

Now I want to remove this proxy setting and have the programs connect directly.

所以我取消设置系统环境变量:

So I unset the system environment variables:

unset http_proxy
unset HTTP_PROXY

选中~/.gitconfig以确保没有代理条目.

Check ~/.gitconfig to ensure that there are no proxy entries.

明确指示git不要使用任何代理:

Explicitly instruct git not to use any proxies:

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仍然尝试通过代理连接:

But git still tries to connect via proxy:

致命:无法访问' https://xxx@bitbucket.org/xxx.git/:失败 连接到127.0.0.1端口3128:连接被拒绝

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确认:

我以为我已通过未设置http_proxy删除了proxy.
但是HTTPS有一个不同的环境变量,需要单独设置.运行env|grep -i proxy揭示了这一点.

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拒绝没有代理的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆