next up previous contents
Next: Merging branches Up: Tags and Branches Previous: Creating branches   Contents

Retrieving a branch

There are two way to download the branch from the repository. The first one is by simply checking out:

svn co https://localhost/svn/repo1/helloworld/branches/br-0.8
       hw-br-0.8

However, if we already have some working copy from trunk or other branch we can switch to a specific branch with svn switch command:

$ cd hw-trunk
$ svn info
Path: .
URL: https://localhost/svn/repo1/helloworld/trunk
$ svn switch https://localhost/svn/repo1/helloworld/branches/br-0.8
$ svn info
Path: .
URL: https://localhost/svn/repo1/helloworld/branches/br-0.8

The calls of svn info before and after svn switch verify that the working copy has been switched to the branch. Switching the branches with svn switch preserves the local modifications.

There is a useful option of svn info called -relocate that is used when the repository's root URL changes, for example when the scheme or the hostname is changed.



Ivan Ivanov 2008-04-21