Friday, 26 August 2011

Just discovered SVN switch command - switch to a different branch instead of doing a full checkout

I've been doing complete checkouts whenever our branches get renamed,
instead of using "svn switch". Not a small pain considering it takes 8
minutes to do a full checkout. Good thing this doesn't happen that
often (and probably the reason I haven't discovered the command. not
painful enough). How embarrassing!


Quick example of using SVN's "switch" command

$ cd calc

$ svn info | grep URL
URL: http://svn.example.com/repos/calc/trunk

$ svn switch http://svn.example.com/repos/calc/branches/my-calc-branch
U integer.c
U button.c
U Makefile
Updated to revision 341.

$ svn info | grep URL
URL: http://svn.example.com/repos/calc/branches/my-calc-branch

Only fewer files need to be updated. More time to read Hacker News. =)

REF: http://www.linxit.de/svnbook/en/1.1/ch04s05.html

No comments: