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

By: SethCardoza - Published: 2008-12-21 23:40:23 in Category: Version Control

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.

Comments on This Post

Bensan George - February 21, 2009 - 10:12:53pm

Great tip Seth.
Post a Comment
(required)
(required) (will not be displayed)
(required)