不能在代理后面做 git-svn fetch

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15095561/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 08:14:09  来源:igfitidea点击:

Cannot do git-svn fetch behind proxy

gitsvngit-svn

提问by bjarven

I'm trying to mirror a svn repo using git-svn.

我正在尝试使用 git-svn 镜像 svn repo。

I'm doing

我正在做

git svn clone http://worldwind31.arc.nasa.gov/svn/trunk/WorldWind

And I'm getting

我得到

Initialized empty Git repository in f:/gstest/WorldWind/.git/
RA layer request failed: PROPFIND request failed on '/svn/trunk/WorldWind': PROPFIND of '/svn/trunk/WorldWind': could not connect to server (http://worldwind31.arc.nasa.gov) at /usr/lib/perl5/site_perl/Git/SVN.pm line 148

If I do the same on another computer that isn't within the proxy it's ok.

如果我在不在代理中的另一台计算机上做同样的事情,那就没问题了。

I'm on a win7, and I've set $HTTP_PROXY, http.proxy(the global one in git) and $HOME/AppData/Roaming/Subversion/serversto the correct proxy.

我在 win7 上,我已经设置了 $HTTP_PROXYhttp.proxy(git 中的全局一个)和$HOME/AppData/Roaming/Subversion/servers正确的代理。

Doing svn checkout [repo adress]in a shell works. Doing wget [repo adress]in a shell works. But not git svn clone [repo adress]

这样做svn checkout [repo adress]在外壳的作品。这样做wget [repo adress]在外壳的作品。但不是git svn clone [repo adress]

Any ideas? Most of the questions I've found on this points me to the Subversion/serversfile, but now I've edited that one and the problem is still there... :/

有任何想法吗?我在此发现的大多数问题都指向该Subversion/servers文件,但现在我已经编辑了该文件,但问题仍然存在......:/

回答by janos

I had the exact same problem.

我有同样的问题。

And the solution is finding the correct Subversion configuration directory. At least in my case the native svn.exeuses the file C:\Users\MYUSER\AppData\Roaming\Subversion\servers, but git-svnuses ~/.subversion/servers. And I mean this path ~/.subversion/serversin the Git Bash shell, where ~is expanded to the right location. Edit ~/.subversion/serversthe same way as the other one used by svn.exeand then git svn cloneshould work.

解决方案是找到正确的 Subversion 配置目录。至少在我的情况下,本机svn.exe使用该文件C:\Users\MYUSER\AppData\Roaming\Subversion\servers,但git-svn使用~/.subversion/servers. 我的意思~/.subversion/servers是 Git Bash shell 中的这条路径,在那里~被扩展到正确的位置。~/.subversion/servers以与使用的另一个相同的方式进行编辑svn.exe,然后git svn clone应该可以工作。

In short, the key is finding the right configuration file to edit, as you may have multiple of them in Windows.

简而言之,关键是找到要编辑的正确配置文件,因为您可能在 Windows 中拥有多个配置文件。

回答by Fredrik Pihl

To get svn to work behind a proxy on linux, update the file ~/.subversion/serverswith the proxy details.

要让 svn 在 linux 上的代理后面工作,请~/.subversion/servers使用代理详细信息更新文件。

[global]
# http-proxy-exceptions = *.exception.com, www.internal-site.org
http-proxy-host = YOURPROXY.com
http-proxy-port = YOURPORT
# http-proxy-username = defaultusername
# http-proxy-password = defaultpassword
# http-compression = no
# http-auth-types = basic;digest;negotiate
# No http-timeout, so just use the builtin default.
# No neon-debug-mask, so neon debugging is disabled.
# ssl-authority-files = /path/to/CAcert.pem;/path/to/CAcert2.pem

I guess there's a similar configuration on windows...

我猜windows上有类似的配置......

回答by VonC

Usually, the environment variables alone:

通常,单独的环境变量:

  • HTTP_PROXY
  • HTTPS_PROXY
  • NO_PROXY
  • HTTP_PROXY
  • HTTPS_PROXY
  • NO_PROXY

are enough for git or git-svn to work properly.

足以让 git 或 git-svn 正常工作。

But what gets me is the exact url to use.
For instance:

但让我想到的是要使用的确切网址。
例如:

  • HTTP_PROXY=wwww.myproxy.company:8080won't work, but
  • HTTP_PROXY=http://wwww.myproxy.company:8080will work.
  • HTTP_PROXY=wwww.myproxy.company:8080不会工作,但是
  • HTTP_PROXY=http://wwww.myproxy.company:8080将工作。

Use the same for HTTPS_PROXY, meaning the same httpaddress (I tried first putting an https url for the HTTPS_PROXY, but that is not how it works)

使用相同的 for HTTPS_PROXY,意味着相同的http地址(我首先尝试为 放置一个 https url HTTPS_PROXY,但这不是它的工作原理)

Of course, if you need to authenticate, you can (at least for testing purposes) add your login/passname in it:

当然,如果您需要进行身份验证,您可以(至少出于测试目的)在其中添加您的登录名/密码:

HTTP_PROXY=http://myLogin:[email protected]:8080

And it helps setting the NO_PROXYone too: localhost,*.company.

它也有助于设置NO_PROXY一个:localhost,*.company.



So the main point behind this answer is "double check the exact url you are using" (and test it with a simple curl http://www.google.com, or with wget, either from the msysgit package or from Gnu On Windows)

因此,此答案背后的要点是“仔细检查您正在使用的确切网址”(并使用来自 msysgit 包或来自的简单curl http://www.google.com或 进行测试)wgetGnu On Windows

回答by CAD bloke

Have a look in C:\Users\YOU\.subversion\servers for the settings. You're looking for something inside this file like...

查看 C:\Users\YOU\.subversion\servers 中的设置。你正在这个文件中寻找一些东西,比如......

[global]
# http-proxy-exceptions = *.exception.com, www.internal-site.org
http-proxy-host = 127.0.0.1
http-proxy-port = 3128

... These settings are for CNTLM. Uncomment the lines I have uncommented above & put your own details in. There are fields for passwords etc. Fixed it for me getting stuff from Sourceforge. Yeah, Sourceforge is still there.

... 这些设置用于 CNTLM。取消注释我在上面取消注释的行并输入您自己的详细信息。有密码等字段。为我从 Sourceforge 获取东西修复了它。是的,Sourceforge 还在。

Also, CNTLM is great for getting through NTLM, forefront etc. Run Fiddler2 & set the rules to "Automatically Authenticate" to true to pick up any auth that CNTLM misses. Chrome updates are one thing that Fiddler fixes for me.

此外,CNTLM 非常适合通过 NTLM、最前沿等。运行 Fiddler2 并将规则设置为“自动身份验证”为 true 以获取 CNTLM 错过的任何身份验证。Chrome 更新是 Fiddler 为我修复的一件事。

回答by Yegoshin Maxim

For me the solution was just to change urlin config. Because I wasn't able to access the existing one. To check I simply accessed the repo url using my browser. In case of using forbidden url I got '403 Forbidden'.

对我来说,解决方案只是为了改变URL配置。因为我无法访问现有的。为了检查,我只是使用浏览器访问了 repo url。如果使用禁止的网址,我会得到'403 Forbidden'