git 代理在 Windows 重新启动后仅几分钟就工作出现问题

时间:2021-03-02 13:07:58

标签: windows git proxy

我公司笔记本电脑上的 git 代理有问题。

我在系统变量中添加了环境变量 HTTP_PROXY、HTTPS_PROXY 和 FTP_PROXY。

重新启动后,我的 git 可以正常工作几分钟,一切都很好 - 推动工作,我可以拉动一切。

但在笔记本电脑工作几分钟后,我遇到了错误:

Push failed unable to access 'https://gitlab.****.com/**/**/': Proxy CONNECT aborted

我不知道该怎么办我已经尝试将 git 配置变量取消设置为 http.proxy、https.proxy 但它没有任何改变。

当我遇到这个错误时,我会重新启动计算机,我可以推或拉,但错误消息没有出现[但只有几分钟!]。

系统:Windows VPN:开启

Git 重新安装没有帮助。

该错误发生在 cmd 和 PyCharm 中。

Git user.name 和 user.email 是正确的。

我还尝试将 http.proxy 和 https.proxy 用作 http://login:pwd@server:port,但它没有任何改变。

请帮助我,谢谢和最好的问候。

1 个答案:

答案 0 :(得分:0)

解决方案:

  • 重新安装git
  • 将 credential.helper 设置为 ../Git/etc/gitconfig 中的 manager-core
  • 将环境变量设置为小写字母 ftp_proxy、http_proxy、https_proxy,并为每个变量使用相同的“http://”前缀
  • 使用 git: 前缀删除所有 Windows 凭据,
  • 从 git config --global -l、--system 和 --local 中删除 http.proxy
  • https://gitlab.domain.com 添加 Windows 凭据(通用)

如果不起作用,请重新安装 Windows 并重试。