问题描述
我有msysGit(Git on Windows)在我的家用机器上工作得很好,但是在工作中,我们在Microsoft ISA代理的后面,当我做一个git clone时,出现以下错误:
H:\> git clone git://github.com/akitaonrails/vimfiles.git
初始化的空Git存储库H:/vimfiles/.git/
github.com [0:65.74.177.129]:errno =无效参数
致命:无法连接套接字(无效参数)
$ c
$ b 我试着设置http_proxy环境变量为:
http://我们的代理服务器:8088
我已设定git http.proxy配置指令:
git config --global http.proxy http:// our-proxy-server: 8088
以上两项均不相同。
使用 http://
而不是 git://
做git克隆会产生这样的结果:
H:\> git克隆http://github.com/akitaonrails/vimfiles.git
在H:/vimfiles/.git/
中初始化了空的Git仓库致命的:http://github.com/akitaonrails/vimfiles.git / info / refs下载错误 - 请求的URL返回错误:407
407当然是验证错误。
所以我的问题是:是否有人设法从代理之后获得git,特别是ISA代理?我不知道这是否值得追求。任何帮助非常感谢。
谢谢!
解决方案完全相同的错误;但是是关键。
如果你有一个带有认证的代理服务器,你需要加入:
git config --global http.proxy http:// login:password @ our-proxy-server:8088
它只是起作用(使用' git clone http:
')
详细介绍相同设置的博客示例:
如果407仍然失败,可能与。 。
2011年1月更新:提及,它增加了这一点:
git config --global http.proxy http:// domain\\\登录名:密码@我们的代理服务器:8088
I've got msysGit (Git on Windows) working just fine on my home machine, but at work, where we are behind a Microsoft ISA proxy, I get the following error when I do a git clone:
H:\>git clone git://github.com/akitaonrails/vimfiles.git
Initialized empty Git repository in H:/vimfiles/.git/
github.com[0: 65.74.177.129]: errno=Invalid argument
fatal: unable to connect a socket (Invalid argument)
I've tried setting the http_proxy environment variable to:
http://our-proxy-server:8088
I've set the git http.proxy configuration directive:
git config --global http.proxy http://our-proxy-server:8088
Neither of the above makes a difference.
Doing a git clone with http://
instead of git://
yields this:
H:\>git clone http://github.com/akitaonrails/vimfiles.git
Initialized empty Git repository in H:/vimfiles/.git/
fatal: http://github.com/akitaonrails/vimfiles.git/info/refs download error - The requested URL returned error: 407
407 is of course an authentication error.
So my question is: has anyone managed to get git working from behind a proxy, specifically an ISA proxy? I don't know if it's going to be worth pursing this. Any help very much appreciated.
Thanks!
解决方案 I had the exact same error; but the ~/.gitconfig
global config file was the key.
If you have a proxy with authentication you need to put in it:
git config --global http.proxy http://login:password@our-proxy-server:8088
And it just works (with 'git clone http:
')
Example of a blog detailing the same setup: GIT clone over HTTP: who knew?
If it still fails in 407, it could be related to a problem with git-fetch losing authentication tokens on the second HTTP GET. A more recent version of libcurl might be needed.
Update January 2011: jbustamovej mentions in his answer (upvoted) his blog post "GitHub Behind Corporate Proxy", which adds this:
git config --global http.proxy http://domain\\\login:password@our-proxy-server:8088
这篇关于Git错误:致命:无法连接套接字(无效的参数)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!