配置的http.proxy适用于git,但不适用于jgit
让我们先显示--global.gitconfig,以git和jgit的形式显示!!! 从DOS窗口和Cgywin窗口配置的http.proxy适用于git,但不适用于jgit,git,jgit,Git,Jgit,让我们先显示--global.gitconfig,以git和jgit的形式显示!!! 从DOS窗口和Cgywin窗口 E:\> git config --list --global http.auth.preference=Basic user.name=Josef Stadelmann user.email=josef.stadelmann@axa-winterthur.ch http.proxy=http://C770817:MyPassword@bcproxyserver.ch.wi
E:\> git config --list --global
http.auth.preference=Basic
user.name=Josef Stadelmann
user.email=josef.stadelmann@axa-winterthur.ch
http.proxy=http://C770817:MyPassword@bcproxyserver.ch.winterthur.com:8080
E:\>
现在让我们从Cygwin窗口查看JGit
$ jgit config --list --global
http.auth.preference=Basic
user.email=josef.stadelmann@axa-winterthur.ch
user.name=Josef Stadelmann
http.proxy=http://C770817:MyPassword@bcproxyserver.ch.winterthur.com:8080
我们可以看到相同的配置
然后
为什么
C770817@C036357 ~
$ jgit ls-remote https://github.com/stadelma/HelloWorld.git
fatal: Connection time out: github.com
fatal: https://github.com/stadelma/HelloWorld.git: cannot open git-upload-pack
超时但是
C770817@C036357 ~
$ git ls-remote http://github.com/stadelma/HelloWorld.git
35f375cb64208b64ed499c2a47727dfcd8813dea HEAD
35f375cb64208b64ed499c2a47727dfcd8813dea refs/heads/master
C770817@C036357 ~
$
在读取相同的.gitconfig时正常工作
/cygdrive/e/mingw/home/.gitconfig
有什么建议吗?欢迎你,还是让我开始调试
Josef您可以尝试看看环境变量是否能更好地工作,java选项如下:
-Dhttp.proxyHost=myproxyhosturl
-Dhttp.proxyPort=8080
-Dhttp.nonProxyHosts=”localhost|mybambooserverurl”
例如:
–代理IP地址Dhttp.proxyHost
–代理端口Dhttp.proxyPort
–如果需要HTTP代理身份验证,则为用户名李>Dhttp.proxyUser
–如果需要HTTP代理身份验证,则为用户密码Dhttp.proxyPassword