小编Sep*_*935的帖子

配置的 http.proxy 适用于 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.winterthur.com:8080

E:\>
Run Code Online (Sandbox Code Playgroud)

现在让我们从带有 JGit 的 Cygwin 窗口中查看

$ 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
Run Code Online (Sandbox Code Playgroud)

我们可以看到相同的配置 那为什么

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
Run Code Online (Sandbox Code Playgroud)

超时但是

C770817@C036357 ~
$ git ls-remote http://github.com/stadelma/HelloWorld.git
35f375cb64208b64ed499c2a47727dfcd8813dea        HEAD
35f375cb64208b64ed499c2a47727dfcd8813dea        refs/heads/master

C770817@C036357 ~
$
Run Code Online (Sandbox Code Playgroud)

在读取相同的 .gitconfig 时正常工作

/cygdrive/e/mingw/home/.gitconfig
Run Code Online (Sandbox Code Playgroud)

???

欢迎任何建议 - 或者 - 我应该开始调试 jgit …

git jgit

6
推荐指数
1
解决办法
1985
查看次数

标签 统计

git ×1

jgit ×1