Next: , Previous: , Up: Branching and merging   [Contents][Index]


5.2 Creating a branch

You can create a branch with tag -b; for example, assuming you’re in a working copy:

$ cvs tag -b rel-1-0-patches

This splits off a branch based on the current revisions in the working copy, assigning that branch the name ‘rel-1-0-patches’.

It is important to understand that branches get created in the repository, not in the working copy. Creating a branch based on current revisions, as the above example does, will not automatically switch the working copy to be on the new branch. For information on how to do that, see Accessing branches.

You can also create a branch without reference to any working copy, by using rtag:

$ cvs rtag -b -r rel-1-0 rel-1-0-patches tc

-r rel-1-0’ says that this branch should be rooted at the revision that corresponds to the tag ‘rel-1-0’. It need not be the most recent revision – it’s often useful to split a branch off an old revision (for example, when fixing a bug in a past release otherwise known to be stable).

As with ‘tag’, the ‘-b’ flag tells rtag to create a branch (rather than just a symbolic revision name). Note that the numeric revision number that matches ‘rel-1-0’ will probably be different from file to file.

So, the full effect of the command is to create a new branch – named ‘rel-1-0-patches’ – in module ‘tc’, rooted in the revision tree at the point tagged by ‘rel-1-0’.


Next: , Previous: , Up: Branching and merging   [Contents][Index]