Difference between revisions of "CVS Commands"

From Rizzo_Lab
Jump to: navigation, search
 
 
Line 38: Line 38:
 
To download the code from the branch called stonybrook
 
To download the code from the branch called stonybrook
 
  cvs co -r stonybrook dock6
 
  cvs co -r stonybrook dock6
 +
 +
==Recursive Editing==
 +
 +
To recursively add new files:
 +
find . -type f -print | grep -v CVS | xargs cvs add
  
 
==References==
 
==References==
 
# http://www.slac.stanford.edu/BFROOT/www/doc/cvs/cvs-babar-basic.html
 
# http://www.slac.stanford.edu/BFROOT/www/doc/cvs/cvs-babar-basic.html
 
# Essential CVS. Jennifer Vesperman. O'Reilly Publishers.
 
# Essential CVS. Jennifer Vesperman. O'Reilly Publishers.

Latest revision as of 19:02, 10 August 2015

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

Recursive Editing

To recursively add new files:

find . -type f -print | grep -v CVS | xargs cvs add

References

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