我尝试过使用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谷歌搜索返回的结果好坏参半,而且可能没有更新结果。它说curl在某个地方(曾经是?)在幕后使用,但它的选项是( its?)硬连接到代码中。例如,
curl --proxy-ntlm --proxy ...:8080 google.com我想在git中使用同样的选项。
我在这里需要一些更明确的答案:有人成功地通过Windows代理使用了git吗?哪个版本?
谢谢。
发布于 2012-06-01 18:49:16
Git从1.7.10版本开始支持NTLM代理身份验证,相关提交为https://github.com/gitster/git/commit/dd6139971a18e25a5089c0f96dc80e454683ef0b
1.7.10 release notes简要地提到了它:
* HTTP transport learned to authenticate with a proxy if needed.我已经在我的工作场所用代理成功地测试了它,它是NTLM,需要用户名/通行证,你可以用以下命令测试自己:
git config --global http.proxy http://user:password@proxy.com:port
git clone http://git.videolan.org/git/bitstream.git致以敬意,
发布于 2015-08-21 03:38:19
默认NTLM凭据
要使用默认NTLM凭据,请提供空的用户名和密码
git config --global http.proxy https://:@proxy:portISA服务器的防火墙客户端
你可以使用微软的Firewall Client for ISA Server来代替为git、npm等设置代理。安装后:
Start > Autostart > Microsoft Firewall Client Management
Settings tab > Manual specified ISA Server > proxy:port Web Browser tab > Uncheck "Enable web browser automatic configuration."
发布于 2009-11-23 23:41:50
克隆对我来说是有效的,但只能通过HTTP (因为我们的公司防火墙阻止了ssh/git协议):
$ export http_proxy="http://username:password@proxy:port/"
$ git clone http://github.com/sunlightlabs/fiftystates_site.git fifty
Initialized empty Git repository in /home/user/fifty/.git/
got e15f5192b923d8e87abaeb9406d0f4d80403da09
walk e15f5192b923d8e87abaeb9406d0f4d80403da09
got a78b792191f1cf5e961753dcfe05e9c809bdb0ed
got 76e6e86e72a0f998f7663da69ca49c457a302e27
walk 76e6e86e72a0f998f7663da69ca49c457a302e27
got 35b68a3b876fb90e73ba7a7eb51432e825ef2aa3
...Github建议通过git://github.com/...进行克隆,但您必须手动将其更改为http://github.com/...。
git:我使用的是Git1.5.6.3版本。
希望这能有所帮助!
https://stackoverflow.com/questions/1783659
复制相似问题