Git克隆错误"CONNECT之后来自代理的HTTP代码504"显示为“ [英] Git clone error "HTTP code 504 from proxy after CONNECT"

查看:1782
本文介绍了Git克隆错误"CONNECT之后来自代理的HTTP代码504"显示为“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在公司防火墙后面的办公室里工作.我的系统是Windows7,使用consola组件.通常,我需要设置代理连接以使GIT与github一起工作.

I'm working in a office behind a corporate firewall. My System is windows7, using componentes consola. Usually I need to set up proxy connections to get GIT working with github.

但是当我尝试在私有Stash(Atlassian)中克隆存储库sored时,出现此错误:

But when I try to clone a repository sored in a private Stash (Atlassian) I get this error:

Cloning into 'apptest'...
fatal: unable to access 'https://xxx@xxx.xx.xx.xx:xxxx/apptest/apptest.git
/': Received HTTP code 504 from proxy after CONNECT

我尚未设置git代理,但是我仍然面临着同样的问题. 请注意,我正在Windows 7上使用GITshell

I have unsetted git proxy but I'm still facing same problem. Please note that I'm using GITshell over Windows 7

任何帮助将不胜感激.

致谢

推荐答案

问题已解决.

Windows :在连接 Bitbucket (又称为隐藏)之前,您需要清除Git和控制台环境中的所有代理:

Windows: Before connecting Bitbucket (AKA stash) you need to clean all proxies from both Git and console environment:

SET HTTP_PROXY=
SET HTTPS_PROXY=
git config --global --unset http.proxy
git config --global --unset https.proxy
git clone http://yourUser@stashAddress:stashPort/apptest.git

但是,如果您需要连接到 github 之类的公共存储库,则有必要再次定义代理:

But if you need to connect to public repositories like github, then it's necessary to define proxies again:

SET HTTP_PROXY=proxyaddress:port
SET HTTPS_PROXY=proxyaddress:port
git config --global http.proxy http://proxyaddress:port
git config --global https.proxy http://proxyaddress:port

我认为这对于在公司防火墙后面工作的其他开发人员可能有用.

I think it may be useful for other developers working behind corporate firewalls.

Linux

unset HTTP_PROXY
unset HTTPS_PROXY
git config --global --unset http.proxy
git config --global --unset https.proxy
git clone http://yourUser@stashAddress:stashPort/apptest.git

再次定义代理:

export HTTP_PROXY=proxyaddress:port
export HTTPS_PROXY=proxyaddress:port
git config --global http.proxy http://proxyaddress:port
git config --global https.proxy http://proxyaddress:port

请注意环境变量的大写字母.某些操作系统版本可能需要小写字母或默认情况下可能已定义小写字母变量.

这篇关于Git克隆错误"CONNECT之后来自代理的HTTP代码504"显示为“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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