Cannot do git-svn fetch behind proxy

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

I’m doing

  • Jenkins (Windows) very slow Git fetch
  • git: how to turn a clone into a new branch?
  • How do I fetch/pull multiple branches matching a wildcard string?
  • Why am I unable to create/checkout this branch?
  • Git Bash won't run my python files?
  • git branch -d <BRANCH>: Fatal - Couldn't look up commit object for HEAD
  • 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/servers to the correct proxy.

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

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

  • SVN: Recursive add
  • Using git, how do you reset the working tree to the state of the index?
  • git hook syntax check
  • Move (or “Undo”) last git commit to unstaged area
  • Recover files that were added to the index but then removed by a git reset
  • Git clone verbose mode – show each incoming object
  • 5 Solutions collect form web for “Cannot do git-svn fetch behind proxy”

    I had the exact same problem.

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

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

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

    [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…

    Usually, the environment variables alone:

    • HTTP_PROXY
    • HTTPS_PROXY
    • NO_PROXY

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

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

    • HTTP_PROXY=wwww.myproxy.company:8080 won’t work, but
    • HTTP_PROXY=http://wwww.myproxy.company:8080 will work.

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

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

    HTTP_PROXY=http://myLogin:myPassword@wwww.myproxy.company:8080
    

    And it helps setting the NO_PROXY one too: 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)

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

    [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.

    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.

    For me the solution was just to change url in 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’.

    Git Baby is a git and github fan, let's start git clone.