SVN Switch – Switching to or from the Trunk to a Branch

I recently had to make my first branch on a project using svn. Making a branch is easy enough with svn copy, but where do you go from there? You could check out a fresh copy of the branch from the repository, but you already have the environment setup and working for the trunk copy. There is an easy and elegant solution, and it lies within svn switch. First navigate to your working copy via the command line. Now to switch to a branch, or tag, in the repository, simply type:

svn switch http://svn.example.com/project/path/to/repo/branch .

Your working copy will now be the branch copy, and any committed changes will go to the branch. It is a simple and easy to use command that should speed up your development.

2 comments

  1. Thanks Seth.

    TortoiseSVN has been giving me issues lately and the command line stuff has proven to be more reliable.

    Trouble is I only know the basic command line stuff (svn up etc) so little tips like these are extremely helpful.

    Many Thanks.

    Chris.

Comments are closed.