User Tools

Site Tools


cvs:merge

This page is shamelessly stolen from http://www.psc.edu/~semke/cvs_branches.html

Merging branches

Using Update

cvs update -j TagOrBranch1 -j TagOrBranch2 my_module

The above command will locate the differences between TagOrBranch1 and TagOrBranch2. Of the lines that are different between them, the lines in TagOrBranch2 will be patched, or merged, into the sources in your working directory.

An annoying problem that I have not yet solved is that new files that appear in TagOrBranch2 but not in TagOrBranch1 do not get created by the merge. The only thing I know of to get these files into the new version is to checkout TagOrBranch2, copy the files into the merged working directory, and do

cvs add filename 

Using Checkout

cvs checkout -j TagOrBranch1 -j TagOrBranch2 my_module

The above command will locate the differences between TagOrBranch1 and TagOrBranch2. Of the lines that are different between them, the lines in TagOrBranch2 will be patched, or merged, into the latest revision on the main trunk of my_module.

In order to have these differences merged into a different branch, and then have that branch checked out, use

cvs checkout -r BranchToMergeTo -j TagOrBranch1 -j TagOrBranch2 my_module

Like update, file that were created between TagOrBranch1 and TagOrBranch2 do not get created automatically.

cvs/merge.txt · Last modified: 2007/11/16 12:32 by deva