- publishing free software manuals
Version Management with CVS - the CVS manual
by Per Cederqvist et al.
Paperback (6"x9"), 216 pages, 8 figures
ISBN 0954161718
RRP £19.95 ($29.95)

Get a printed copy>>>

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 section 5.3 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 is 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’.

ISBN 0954161718Version Management with CVS - the CVS manualSee the print edition