Monday, September 21, 2009
Pointing an SVN working copy to a different server
Having moved a bit recently and being busy at the same time, I still haven't got round to setting up my home network quite the way I'd like it. With the result that a while back I checked out some code from a Subversion repository to a laptop, and when I came to check it back in the LAN IP of the box with the repository on it had changed. Of course the working copy was still pointing to the old IP, making it impossible to commit my code changed, and the cheap consumer-grade router which looks after the network doesn't seem capable of assigning IP addresses based on MAC address. How to get the working copy pointed at the changed IP address?
Castig about in the .svn
directories in the working copy, each contains a text file named "entries
" which in turn contains two lines which look like this:
svn+ssh://192.168.0.5/path/to/svn/project/trunk
svn+ssh://192.168.0.5/path/to/svn
Manually updating the IP address seemed to work for that directory, so a simple
sed -i 's/svn+ssh:\/\/192\.168\.0\.5\//svn+ssh:\/\/svn.local\//'
took care of the entire working copy. Rather than just update the IP address I created an entry in /etc/hosts
for svn.local
, so should the repository IP address change again before I get things sorted, all I need to do is update the IP address here rather than mess about with SVN internals.
(Another workaround would be to make a tarball of the working copy without the .svn directories, delete the working copy, check it out again and untar the code over the new working copy.)
Posted at 1:25 AM |Comments (0)