SVN Copy – Creating a Branch or Tag

Tagging and branching with svn are as simple as using the copy command. For this tutorial, I will assume that your repository has the following structure:




To create a tag of the trunk, run the following command:

svn copy

To create a tag of your current working copy (assuming you are in that directory on your local machine):

svn copy .

To tag a branch, say before merging the branch back into the trunk, run the following command:

svn copy

To create a branch of the trunk:

svn copy

To create a branch of your current working copy:

svn copy .

Tags should only be used to create snapshots of the repository. No development should be done on a tag, meaning you should never commit code to a tag. Branches are used for development that you do not want to interfere with everyday activity. They can be used for experimental code, code that you may only want to have run on your local machine, but still would like to have the power of version control behind your code. There are many other situations in which you would want to use a tag or a branch. You can read more about subversion and tags and branches on Wikipedia.

1 comment

  1. Hi,

    in branches i copied a new branch folder. Its normally only in subversion, not a real folder on my server?! I tried to delete this new_folder with

    svn delete ^/branches/new_branch -m

    and i get: svn: >>.<< is no working copy

    Maybe you can say, how i can delete this new_branch folder in svn completely.

Comments are closed.