Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Mar 29 '10 at 12:39

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

add comment

3 Answers

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

share|improve this answer
    
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 '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
add comment

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
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

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