CVS Commands

From Rizzo_Lab
Revision as of 18:05, 27 February 2009 by Sudipto (talk | contribs)
(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Checking out a distribution

To checkout the main trunk from the CVS tree, use

cvs co {distribution name}

To check out branch rizzo_xlogp from the date Jul 05, 2007.

cvs co -r rizzo_xlogp -D '2007-07-05'

CVS Diff

To get the diff between the working copy of a file and the CVS copy use

cvs diff file.cpp

This command compares the file with the main trunk. Can be used to get a diff between the current branch and the main trunk.

cvs diff -Dnow {file}

To compare a file in the working directory with the corresponding file in another branch new_branch, use

cvs diff -r new_branch dock.cpp

Updating the working directory

Before performing a commit, check which files have been modified from the working version.

cvs -n update -dA   [list all files that have been modified]
     U {file1}        [there is new version in CVS, no diff needed]
     M {file2}        [there is new version in local folder, need diff]
     C {file3}        [there are new version in CVS and local folder, need diff] 
cvs diff -Dnow {file} [examine the diff with HEAD]

To merge the current branch with the main trunk, use

cvs update -dA {file}         [merge with HEAD version]

Committing changes to the tree

Shortcut to commit changes to the CVS tree.

cvs ci

Creating a branch

cvs tag -b stonybrook
cvs update -r stonybrook

To download the code from the branch called stonybrook

cvs co -r stonybrook dock6

References

  1. http://www.slac.stanford.edu/BFROOT/www/doc/cvs/cvs-babar-basic.html
  2. Essential CVS. Jennifer Vesperman. O'Reilly Publishers.