1

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 192.168.1.200), 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.

Sergio

3 Answers 3

1

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: http://svnbook.red-bean.com/en/1.0/re27.html (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://anonsvn.opensource.apple.com/svn/webkit/trunk \ http://svn.webkit.org/repository/webkit/trunk

2
  • Thanks. I used svn switch --relocate svn://192.168.1.240/projectname svn://xxx.xxx.xxx.xxx/projectname, 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, 2010 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, 2010 at 5:27
0

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.

1
  • Thanks, but I have already enabled the correct port forwarding.
    – SergioP
    Mar 28, 2010 at 22:10
0

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 svn.example.com. If you refer using a DNS name instead of IP address, your problem can be easily solved by adding an entry to locahost file.

You must log in to answer this question.