Setting up a development branch in CVS
If you need to fix a bug in an
older version of your code without changing current code, or modify a
configuration set for staging servers without modifying the set for
your production servers, you might need to branch your modules. A
branch allows storage and retrieval of a variation of the main
module, without affecting the main module. Changes on the branch can
be merged in later. To make a branch, use
branchtag, as in:
cvs/example$ cvs tag -b release-1-0-patches
Retrieve a branch using either checkout or update. Checkout will create a new directory for the branch, and update will overwrite your current working directory with the branch.
cvs checkout -r branchtag cvs update -r branchtag
cvs/example-rel-1.0$ cvs checkout -r release-1-0-patches cvs/example$ cvs update -r release-1-0-patches
Branches can be merged back into the main trunk, using the conflict resolution system invoked by cvs update and cvs commit.
cvs checkout module cvs update -j branchtag
/tmp/example$ cvs checkout example /tmp/example$ cvs update -j release-1-0-patches
Or in a single command:
cvs checkout -j branchtag module
The following example:
/tmp/example$ cvs checkout -j release-1-0-patches example
resolves any conflicts the system reports, then use cvs commit.