In Subversion, a branch is just a copy of a directory that you check things into, while a tag is a copy that you don't check things into. To set up branches and tags, it's best to have a structure that clearly identifies where branches and tags live. We recommend one of the following:

Approach A: Top-Level

At the top of your repository, create three directories:

  • /branches
  • /tags
  • /trunk
Approach B: Per Product

If you have multiple products in a single repository, you'd follow approach A, but you'd do it at the product level. So if you had a repository at https://plX.projectlocker.com/my_account/my_project/svn/productA, the branches, tags, and trunk would all be under productA rather than under svn.


Creating Branches
To create a branch, you'll do the equivalent of the following:

svn cp https://plX.projectlocker.com/my_account/my_project/svn/trunk https://plX.projectlocker.com/my_account/my_project/svn/branches/my_new_branch_name  -m "Creating branch my_new_branch_name"

You'd then point your working copy at the branch using svn switch or the equivalent for your client.

Creating Tags
Tags work the same way as branches, except tags should be immutable, and so you shouldn't ever check out a tag into a working copy, though you can export it for deployment. We recommend you make tags read-only for most of the team using Subversion permissions so that people don't accidentally modify code in them.