Git错误:致命:无法连接套接字(无效参数)

Cha*_*per 48 windows git proxy msysgit

我有msysGit(Windows上的Git)在我的家用机器上正常工作,但在工作中,我们在Microsoft ISA代理后面,当我执行git克隆时出现以下错误:

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)
Run Code Online (Sandbox Code Playgroud)

我已经尝试将http_proxy环境变量设置为:

http://our-proxy-server:8088
Run Code Online (Sandbox Code Playgroud)

我已经设置了git http.proxy配置指令:

git config --global http.proxy http://our-proxy-server:8088
Run Code Online (Sandbox Code Playgroud)

以上两者都没有区别.

用git克隆http://而不是git://产生这个:

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
Run Code Online (Sandbox Code Playgroud)

407当然是认证错误.

所以我的问题是:有没有人设法让git从代理后面工作,特别是ISA代理?我不知道是否值得追求这个.任何帮助非常感谢.

谢谢!

Von*_*onC 61

我有完全相同的错误; 但~/.gitconfig全局配置文件是关键.

如果你有一个带身份验证的代理,你需要输入它:

git config --global http.proxy http://login:password@our-proxy-server:8088
Run Code Online (Sandbox Code Playgroud)

它只是工作(与' git clone http:')

详细介绍相同设置的博客示例:HTTP上的GIT克隆:谁知道?


如果它在407中仍然失败,则可能与git-fetch在第二个HTTP GET上丢失认证令牌的问题有关.一个libcurl中的较新版本可能需要.


2011年1月更新:jbustamovej他的回答(upvoted)中提及他的博客文章" GitHub Behind Corporate Proxy ",其中补充说:

需要注意的是很重要的,如果你登录有一个反斜杠,如,domain\login,你必须转义反斜线,如:

git config --global http.proxy http://domain\\\login:password@our-proxy-server:8088
Run Code Online (Sandbox Code Playgroud)


shi*_*iva 19

即使在配置代理之后,您也可能无法连接,因为代理不允许git协议流量.在这种情况下,您可能想尝试使用"http"而不是"git"

H:> git clone http://github.com/akitaonrails/vimfiles.git

此外,如果您使用自动代理配置文件(.pac),只需在文本编辑器中打开它.使用脚本语言非常容易,有一系列条件可以重定向到最有效的代理.找到允许通用流量的通道(通常是最后配置的代理),并按照上面的注释中的说明进行配置.