I want to check code from the repository http://code.sixapart.com/svn/perlbal/ . I can only access the the repository url by setting a proxy. I guess if I want to get the code from the same URL by svn I need to configure a proxy, too. So does anyone of you could tell me how to configure a HTTP proxy in svn?
By the way, I use the command-line svn
client under Linux.
Have you seen the FAQ entry What if I'm behind a proxy??
... edit your "servers" configuration file to indicate which proxy to use. The files location depends on your operating system. On Linux or Unix it is located in the directory "~/.subversion". On Windows it is in "%APPDATA%\Subversion". (Try "echo %APPDATA%", note this is a hidden directory.)
For me this involved uncommenting and setting the following lines:
#http-proxy-host=my.proxy
#http-proxy-port=80
#http-proxy-username=[username]
#http-proxy-password=[password]
On command line : nano ~/.subversion/servers
You can find the instructions here. Basically you just add
[global]
http-proxy-host = ip.add.re.ss
http-proxy-port = 3128
http-proxy-compression = no
to your ~/.subversion/servers
file.
In windows 7, you may have to edit this file
C:\Users\
[global]
http-proxy-host = ip.add.re.ss
http-proxy-port = 3128
There are two common approaches for this:
Specify http-proxy- options in your /etc/.subversion/servers or %APPDATA%\Subversion\servers file,
Use --config-option command-line option to specify the same http-proxy- options in single command-line you run. For example, svn checkout ^
--config-option servers:global:http-proxy-host=
If you are on Windows, you can also write http-proxy-
options to Windows Registry. It's pretty handy if you need to apply proxy settings in Active Directory environment via Group Policy Objects.
alias svn-my-proxy='svn --config-option ...'
to be able to use svn-my-proxy co http://svn/repo/trunk
. This allows you to easily switch between proxy (svn-my-proxy co
) and no-proxy (svn co
) configurations depending on what network your machine is on at the time. You can add the alias
command to your ~/.bashrc
to be recreated on next bash login. Helps me a lot between my work network and my home network!
In TortoiseSVN you can configure the proxy server under Settings=> Network
Most *nixen understand the environment variable 'http_proxy' when performing web requests.
export http_proxy=http://my-proxy-server.com:8080/
svn co http://code.sixapart.com/svn/perlball/
should do the trick. Most http libraries check for this (and other) environment variables.
http_proxy
convention seems to work (SVN v1.8.10). But it doesn't under Centos 6.6 (SVN v1.6.11). I searched in their changelog but didn't find anything clear enough. Any idea if it's been patched for good ?
Success story sharing