Working with Tags, Branches, and Merging Branches in CVS
by Jeff Hunter, Sr. Database Administrator
This article provides a brief look into the use of Tags and Branches within CVS along with how to merge branches. This document assumes a basic familiarity with basic CVS concepts including what a CVS module and repository is, along with how to perform simple check-in, check-out, and commit operations.Tags
Before going into the details of tags and branches, let's take a look at some of the concepts that will be covered in this document:
- Tree structure
When you store code in a CVS repository, you can think of it has a tree. The shape of the tree in this context, is not based on the directory structure of the code, but rather on the different versions of the code.
When code gets modified and is committed back in to the repository, it adds another revision is created. The tree gets extended with this new revision. If you did not specify a branch when checking out the code to the working directory, the tree simply grows in a line along the main trunk of the tree.
Tags are used to name a particular version of the code. Developers can then use the tagged version of the code to compare different revisions, to go back to an earlier version, or to specify a place to create a branch from.
Branches allow different development paths to be worked on within the CVS tree. Branches can be created from the main trunk (HEAD), or from other branches.