Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I usually work with a svn repository located in my local office network. Sometimes, when I'm home, I need to connect to my office svn repository.
The problem is that, when I'm in office, to reach the svn repo I use an internal LAN IP (like, but when I'm home the IP is different, because I reach the server from an externel connection. How can I set up svn to work from my home?

Can someone help me? Thanks.


share|improve this question

migrated from Mar 29 '10 at 12:39

This question came from our site for professional and enthusiast programmers.

Assuming the external access is already set up, you can use 'svn switch --relocate' to switch back and forth between internal and external urls.

Doc: (see the last part about --relocate)

If you're using TortoiseSVN, it has a 'relocate' feature.

Here's a command-line example (taken from Safari website)

svn switch --relocate svn:// \

share|improve this answer
Thanks. I used svn switch --relocate svn:// svn://, but it seems it doesn't works because if I run "svn info" command after the relocate command the address is not changed... – SergioP Mar 28 '10 at 22:10
hmm. looks like i forgot a dot. try running it again with a dot at the end (representing current folder), then running svn update. e.g. below is from the manual page $ svn switch --relocate file:///tmp/repos file:///tmp/newlocation . $ svn update At revision 3. – laher Mar 29 '10 at 5:27

Assuming you have a typical Wifi network setup at home you need to enable port forwarding on the router. This will allow the requests to be forwarded from the external IP address to the internal machine. You need to explain more about how SVN is setup so that more specific instructions could be provided but if you host SVN using Apache then you need to forward port 80 or 443 depending on whether you use SSL or not. Updating these settings incorrectly could make your network insecure.

share|improve this answer
Thanks, but I have already enabled the correct port forwarding. – SergioP Mar 28 '10 at 22:10

You should explain more on your network setup. But I guess that your access from home is done by simple IP forwarding. This practice is not safe. A better solution is to set up a VPN. With VPN you can access computers in your office using their IP addresses directly. This will solve your problem.

Also using IP address is not a good practice referring to a SVN. It binds your access to an IP address which I consider non-portable. You should refer to SVN using a fully qualified DNS name, such as If you refer using a DNS name instead of IP address, your problem can be easily solved by adding an entry to locahost file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.