Chapter 4. Tagging and Branching
One of the most helpful yet underused facilities of CVS is the
tag
.
CVS’s tagging feature allows you to label a revision
for later retrieval. This feature also allows you to fork development
so that you can work on two or more versions of your project
simultaneously. The version that has been forked off is called a
branch
,
and the main line of development is called the
trunk
.
This chapter explains tags, branches, and how to merge branches and trunks. It also discusses why and when to branch and provides strategies and hints for using branches effectively in your project.
Tagging
CVS allows you to retrieve any checked-in revision of a file. While retrieving revisions of individual files is useful, it’s even more useful to be able to retrieve the compatible set of revisions that make up a complete, functional version of a project, such as all the revisions that become release 1.0 of a program, or that become the first edition of a book.
Tagging is a way of marking a group of file revisions as belonging together. You can’t use the revision numbers for this purpose, because revision 2.3 of one file might belong with revision 2.17 of another. Figure 4-1 shows a group of file revision numbers, with a string denoting which revision numbers belong to the same release.

Figure 4-1. File revisions that belong together
CVS allows you to create a single tag that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access