【问题标题】:Proxy issues on git and ssh - Arch linuxgit 和 ssh 上的代理问题 - Arch linux
【发布时间】:2016-12-19 06:55:10
【问题描述】:

我工作的公司最近从网络中删除了代理。

我无法让 git 忘记代理。它仍然使用旧的代理设置。

我试过了:

git config --system --unset https.proxy
git config --system --unset http.proxy
git config --global --unset https.proxy
git config --global --unset http.proxy

也试过了,

git config --global --unset core.gitproxy

git config -l 的输出

user.name=my.name
user.email=my.email.address
user.user=my.name
core.autocrlf=input

我正在使用 Manjaro Linux(基于 Arch Linux)。我从 /etc/environment 中删除了代理设置。

唯一有效的就是做

export https_proxy=""
export http_proxy=""

在发出任何 git 命令之前。

在 bashrc 或 /etc/profile 中没有给出代理设置。

我也无法 ssh。

浏览器、Maven 和其他浏览器工作正常。任何帮助将不胜感激。

【问题讨论】:

  • ssh 命令 (ssh -vvv) 发布详细日志。你看到了什么错误?
  • debug1:读取配置数据 /etc/ssh/ssh_config debug2:解析“{ip address}”端口 22 debug2:ssh_connect_direct:needpriv 0 debug1:连接到 {ip address} 端口 22。连接超时ssh:连接到主机{ip地址}端口22:连接超时
  • /etc/environment更改后你重启了吗? ~/.profile 怎么样。 ~/.bash_profile, ~/.pam_environment?
  • 还验证git config -l 的输出是否包含任何代理提及,并相应地更新问题。

标签: linux git ssh proxy archlinux


【解决方案1】:

这个问题困扰了我一段时间。我有一种感觉,只要我问它,我就会找到答案。

原来 Arch Linux 使用另一个文件作为代理,只有少数应用程序使用。此文件中的代理设置不是系统范围的,这就是我在 /etc/environment 中删除代理后能够使用浏览器和其他应用程序的原因。

有一个文件

/etc/profile.d/proxy.sh

具有代理设置。删除它并重新启动解决了问题。

感谢您的帮助。

【讨论】:

  • 您可能希望接受这个作为答案,所以这个问题将被标记为已回答。
  • @eis 完成。谢谢你的帮助。
【解决方案2】:

关键是发git config --list(短版是git config -l)看看有没有配置成git。

如果是,请通过~/.gitconfig.git/config(在 repo 中)、$(prefix)/etc/gitconfig$XDG_CONFIG_HOME/git/config$GIT_DIR/config 查看配置在哪里并将其删除。

如果不是,我猜想http_proxy 取消修复它,通过~/.profile~/.bash_profile~/.pam_environment 并删除代理定义条目,除了/etc/environment/etc/profile , .bashrc 你说你已经做到了。

【讨论】:

  • git config --list 没有显示任何代理。 ~/.gitconfiggit config -l 相同。回购中.git/config 中只有核心、远程和分支信息。没有文件 $XDG_CONFIG_HOME/git/config$GIT_DIR/config。没有~/.profile file/etc/profile 中没有提及代理。 ~/.bash_profile 中没有代理配置。没有文件~/.pam_environment。我也试过重启。更新了有问题的git config --list 的输出。
猜你喜欢
  • 2019-07-12
  • 2015-12-15
  • 1970-01-01
  • 2016-05-04
  • 2018-09-27
  • 1970-01-01
  • 2020-09-27
  • 2012-03-03
  • 2018-03-29
相关资源
最近更新 更多