git拒绝连接没有代理

Ksh*_*rma 9 git proxy

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

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

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

unset http_proxy
unset HTTP_PROXY
Run Code Online (Sandbox Code Playgroud)

检查~/.gitconfig以确保没有代理条目.

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

git config --global --unset http.proxy
git config --global --unset https.proxy
Run Code Online (Sandbox Code Playgroud)

验证没有配置代理:

git config --system --get https.proxy 
git config --global --get https.proxy 
git config --system --get http.proxy 
git config --global --get http.proxy 
Run Code Online (Sandbox Code Playgroud)

然后推送到远程仓库:

git push
Run Code Online (Sandbox Code Playgroud)

git仍尝试通过代理连接:

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

为什么不放手cntlm

Von*_*onC 15

最简单的检查是:

env|grep -i proxy
Run Code Online (Sandbox Code Playgroud)

OP确认:

我以为我已经proxy被取消了http_proxy.
但是HTTPS有一个不同的环境变量,需要单独取消设置.跑步env|grep -i proxy透露了.


小智 7

  1. 使用cat ~/.它会列出所有文件。
  2. 使用cat ~/.gitconfig它将打开文件的内容。
  3. 如果您发现任何代理,请将其删除,例如

    [http]代理= http: //127.0.0.1:3128

  4. 您可以使用nano ~/.gitconfig命令将其删除。

  5. 现在这个命令就可以工作了。

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )"

还记得删除所有代理,例如

unset http_proxy="http_proxy"
unset https_proxy=$http_proxy
unset ftp_proxy=$http_proxy
unset rsync_proxy=$http_proxy
unset HTTP_PROXY=$http_proxy
unset HTTPS_PROXY=$http_proxy
unset FTP_PROXY=$http_proxy
unset RSYNC_PROXY=$http_proxy
Run Code Online (Sandbox Code Playgroud)

请记住从系统首选项网络中删除代理,并取消选中代理现在尝试执行的所有复选框。