Branches of a module are parallel versions of this module. A good real life example of the use of this feature is the release of a software project. After a major release, there are bugs in the code that should be fixed, but people want to add new features to the application too. It is very hard to do both at the same time because new features usually introduce new bugs, making it hard to track down the old ones. To solve this dilemma, CVS lets you create a parallel version, that we will call the “stable release branch”, where you can only add bugfixes, leaving the main branch (HEAD) open for adding new features.
Tags are used to mark a version of a project. CVS stamps one version of each file with the tag, so when you checkout or update to a specific tag, you will get always the same file versions; therefore, as opposed to branches, tags are not dynamic: you cannot develop a tag. Tags are useful to mark releases, big changes in the code, etc.
When you are developing or following the development of a software project, you do not necessarily work with the main branch all the time. After a release, you may want to stay with the released branch for a while, to enjoy its relative stability, fix bugs, translate the sources, etc. To do all that, you have to update to the released branch. All your files will be updated to the latest version of the files in that branch. After updating, all your new commits will be uploaded to the new branch as well.
Also, if you want to track a bug that was reported against a past tagged release, CVS offers you the possibility to retrieve the software as it was released, by updating to that tag. Besides, if you want to fetch a past version of your project, you can update your working copy to a specific date. This may be useful if an error was introduced in the project between two releases, and you have an opinion on when that was. When you update to a date or tag, the versions of your files will be the same as the versions in that specific date or the versions stamped by that tag.
Before updating to a different branch or tag, make sure you committed all your changes to the branch you are working with. If your are not ready to commit your changes, but do not want to discard them, do not update to the new branch, as you may lose your changes. As an alternative, you can do a new checkout, to work in parallel with both versions.
- Update to branch
Select this option to update to a branch. Enter the name of the branch in the drop down text box (or press the Fetch List button to retrieve the list of branches from the CVS server, and select the one you want in the drop down list).
- Update to tag
Select this option to update to a tag. Enter the name of the tag in the drop down text box (or press the Fetch List button to retrieve the list of tags from the CVS server, and select the one you want in the drop down list).
- Update to date
Select this option to update to a date. In the field below, you can enter a wide variety of date formats. One possible format is
yyyyis the year,
mmis the month (numerically) and
ddis the day. Alternatives are some English phrases like
2 weeks ago.
Updating to a tag or date make them 'sticky', i.e. you cannot commit further modifications on that files (unless the tag is a branch tag). In order to get back to the main branch, use the menu item → .
The command issued to update to a branch or tag is:
cvs update -r
The command issued to update to a date is:
cvs update -D
The command issued to update to the main branch (HEAD) is: