December 19, 2004
Creating a branch in CVS
When you create a branch in a CVS tree it is a good idea to keep in mind that you may want to merge the branch back into the main trunk at some point. Now how would you go about this? What would be the best way? Many would say, and I agree with them, that when merging time came you'd want to find the differences between the current trunk and the point at which the branch split off from the trunk as well as find the differences between the tip of the branch and this same split-point.
The first set of differences represent progress that has been made on the trunk since the branch started. It is likely to be quite different to the kind of changes made on the branch. But there should be some sort of semantic cohesion to these changes - they should all fit together. Having these changes, isolated, not mixed up with the changes made to the branch should make the merging process all the easier.
This is why, prior to creating a branch, we must tag the tree to create what is known as a branch-point. Only then do we create a branch by passing the -b option to the tag command of CVS. In summary:
cvs tag project-name-branch-point
cvs tag -b project-name-branch