Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
配置的http.proxy适用于git,但不适用于jgit_Git_Jgit - Fatal编程技术网

配置的http.proxy适用于git,但不适用于jgit

配置的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

让我们先显示--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.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”
例如:

  • Dhttp.proxyHost
    –代理IP地址
  • Dhttp.proxyPort
    –代理端口
  • Dhttp.proxyUser
    –如果需要HTTP代理身份验证,则为用户名
  • Dhttp.proxyPassword
    –如果需要HTTP代理身份验证,则为用户密码