How to use SVN behind proxy on Linux

Last updated on October 19, 2020 by Dan Nanni

If your Linux host is behind a corporate proxy, and you are trying to access a SVN repository located outside the corporate network, you will need to configure proxy settings in subversion, so that you can use SVN through a proxy.

While most Linux applications that require network access respect http_proxy environment variable, subversion ignores http_proxy variable. Thus, in order to use SVN behind proxy, you instead need to rely on SVN-specific configuration file.

In subversion, you can find SVN configuration files in the following two different locations: /etc/subversion, and ~/.subversion. The former stores system-wide SVN configurations, while the latter contains user-specific SVN configurations that override system-wide default settings.

In order to allow you to use SVN behind proxy, edit ~/.subversion/servers as follows.

$ vi ~/.subversion/servers
[global]
http-proxy-host = proxy.com
http-proxy-port = 8000
http-proxy-username = user
http-proxy-password = pass
http-proxy-exceptions = *.domain.com

If you would like to configure an HTTP proxy for SVN for all users system-widely, edit /etc/subversion/servers similarly.

One thing to clarify is that depending on the filtering rules of your proxy, you may not be able to use all available transport protocols for SVN (e.g., http://, https://, svn://). If the SVN repository to access only supports SVN protocol (i.e., svn://), and your proxy blocks the port number (e.g., 3690) used by SVN protocol, you cannot access the repository even with the above proxy settings, unless you create a separate tunnel through the proxy.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean