尝试通过代理克隆的 Git 连接超时

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9736325/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 06:36:36  来源:igfitidea点击:

Git connection time out trying to clone via proxy

gitproxy

提问by user900785

I am getting a connection timeout error when I try to clone a Git repo via a proxy server.

当我尝试通过代理服务器克隆 Git 存储库时出现连接超时错误。

git clone http://opensource.freescale.com/pub/scm/imx/linux-2.6-imx.git
Cloning into linux-2.6-imx...
error: Failed connect to opensource.freescale.com:8080; Connection timed out while accessing http://opensource.freescale.com/pub/scm/imx/linux-2.6-imx.git/info/refs

fatal: HTTP request failed

git clone http://opensource.freescale.com/pub/scm/imx/linux-2.6-imx.git
Cloning into linux-2.6-imx...
错误:无法连接到 opensource.freescale.com:8080; 访问时连接超时http://opensource.freescale.com/pub/scm/imx/linux-2.6-imx.git/info/refs

致命:HTTP 请求失败

I used corkscrew and set my git proxy to the server address and port. How else can I download or clone a Git repo over proxy?

我使用了开瓶器并将我的 git 代理设置为服务器地址和端口。我还能如何通过代理下载或克隆 Git 存储库?

回答by Peter Tillemans

you do not need corkscrew for accessing a http repo behind a proxy server.

您不需要开瓶器来访问代理服务器后面的 http 存储库。

set the environment variable http_proxy

设置环境变量 http_proxy

export http_proxy=http://<proxy>:<port>/

and then git will use the http proxy

然后 git 将使用 http 代理

see also http://roshansingh.wordpress.com/2008/08/29/using-git-behind-proxy/

另见http://roshansingh.wordpress.com/2008/08/29/using-git-behind-proxy/