【发布时间】:2010-12-19 12:17:49
【问题描述】:
我已经尝试过使用export http_proxy=http://[username]:[pwd]@[proxy] 和git config --global http.proxy http://[username]:[pwd]@[proxy]。
我无法让它工作。看起来 git 使用基本身份验证:
Initialized empty Git repository in /home/.../.git/
* Couldn't find host github.com in the .netrc file, using defaults
* About to connect() to github.com port 8080 (#0)
* Trying 10.... * Connected to github.com (10....) port 8080 (#0)
* Proxy auth using Basic with user '...'
> GET http://github.com/sunlightlabs/fiftystates.git/info/refs HTTP/1.1
Proxy-Authorization: Basic MD...
User-Agent: git/1.6.1.2
Host: github.com
Pragma: no-cache
Accept: */*
Proxy-Connection: Keep-Alive
< HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to t
he Web Proxy filter is denied. )
< Via: 1.1 ...
< Proxy-Authenticate: Negotiate
< Proxy-Authenticate: Kerberos
< Proxy-Authenticate: NTLM
< Connection: Keep-Alive
< Proxy-Connection: Keep-Alive
< Pragma: no-cache
< Cache-Control: no-cache
< Content-Type: text/html
< Content-Length: 4118
* The requested URL returned error: 407
* Closing connection #0
fatal: http://github.com/sunlightlabs/fiftystates.git/info/refs download error - The requested URL returned error: 407
Google 搜索返回的结果不一,而且可能没有更新。它在某处说curl (曾经?)在幕后使用,但它的选项(曾经?)硬连线到代码中。例如,
curl --proxy-ntlm --proxy ...:8080 google.com
有效,我想在 git 中使用相同的选项。
我需要一些更明确的答案:有人通过 Windows 代理成功使用 git 吗?哪个版本?
谢谢。
【问题讨论】:
-
目前我正在使用代理网关在 NTLM 代理和 git 识别的“常规”代理之间进行转换。它是 NTLM APS:ntlmaps.sourceforge.net。我记得这是一个很常见的解决方案,例如适用于 Linux 包管理器。
-
我将 NTLMAPS 用于 Subversion,但不适用于 git。
-
使用 NTLMAPS,我得到致命:无法访问'github.com/gruehle/exclude-folders':CONNECT 后从代理收到 HTTP 代码 407。知道为什么吗?