Cannot do git-svn fetch behind proxy

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

I’m doing

  • Adding existing source code folder to Git
  • fatal: Not a valid object name: 'master'
  • git error “Please tell me who you are.” and Heroku
  • Does `git reset HEAD file` also check out the file?
  • How to list branches that contain a given commit on a specific repository?
  • Integrating public git repository into private project (without submodules or subtree merge)
  • git svn clone

    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 ( at /usr/lib/perl5/site_perl/Git/ 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… :/

  • History or log of commands executed in Git
  • Is it possible to encrypt the content stored in SVN?
  • How to use a “private” .xcconfig in a “Shared” (git-managed) Xcode project?
  • Git on Windows and file attributes
  • The meaning of tracking in git
  • Is there any harm letting a git branch “grow old”?
  • 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.

    # http-proxy-exceptions = *,
    http-proxy-host =
    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:

    • NO_PROXY

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

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

    • won’t work, but
    • HTTP_PROXY= 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:


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

    # http-proxy-exceptions = *,
    http-proxy-host =
    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.