【发布时间】:2011-12-05 18:40:50
【问题描述】:
我想在工作中连接到 GitHub,需要通过 http 代理。我可以使用 cURL 使用命令退出 FTP
curl -v -g --ftp-pasv --upload-file MYFILE --proxy PROXYADDRESS:PROXYPORT --proxy-ntlm --proxy-user WINDOWSDOMAIN\WINDOWSUSER:WINDOWSPASSWORD ftp://FTPUSER:FTPPASS@FTPURL/
到目前为止,我无法为 Git 提供等效设置。
我尝试按照 cygwin 下 Using Github Through Draconian Proxies 的说明进行操作。
我已经安装了开瓶器并尝试通过 SSH 连接到 GitHub
ssh github.com
或
ssh ssh.github.com
我回来了
ssh:无法解析主机名 ssh.github.com:提供主机名或服务名,或未知。
我已尝试设置 http 和 https 代理。
这是 git --config -l 的输出
core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=C:/Program Files/Git/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
user.name=Peter Wilkinson
user.email=someemail@gmail.com
github.user=ProggerPete
github.token=shouldprobablykeepthissecret
http.proxy=http://somedomain\someuser:somepass@10.167.116.142:80
https.proxy=http://somedomain\someuser:somepass@10.167.116.142:80
我也跑了
export https_proxy=http://somedomain\someuser:somepass@10.167.116.142:80
export http_proxy=http://somedomain\someuser:somepass@10.167.116.142:80
set https_proxy=http://somedomain\someuser:somepass@10.167.116.142:80
set http_proxy=http://somedomain\someuser:somepass@10.167.116.142:80
然后我尝试克隆并获取。
$ git clone https://ProggerPete@github.com/project/JavaScript-Maven-Plugin.git
Cloning into JavaScript-Maven-Plugin...
Password:
error: The requested URL returned error: 407 while accessing https://ProggerPet
@github.com/project/JavaScript-Maven-Plugin.git/info/refs
fatal: HTTP request failed
在我看来,我的代理身份验证失败。但是,我使用的是相同的登录名并通过 cURL 用于 FTP。
如何连接?
【问题讨论】: