Quick Guide to CVS

From Geos-chem
Revision as of 18:38, 6 December 2016 by Bmy (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


NOTE: The GEOS-Chem adjoint now uses the Git source code management system instead of CVS. We shall preserve this information for reference.

We recommend first taking a look at CVS manual to get a general feel for how this tools works (e.g., http://cvsbook.red-bean.com/cvsbook.html).

Below are some command commands you may use for developing code and checking the status of code updates.

Basic commands

Obtain the latest code:

cvs checkout gcadj_std

Generate a list (modified_files.txt) of all the files in your local copy that differ from the current repository code:

cvs -q status | grep 'Status' | grep -v 'Up-to-date' > modified_files.txt

Determine the difference between your local copy of a file and the version that you originally checked out (i.e., see what you changed):

cvs diff foo_mod.f

Note: arguments such as a filename are optional. Without listing a specific file, cvs will run the command on all files in the current directory.

Determine the difference between your local copy of the code the current version in the repository (i.e., see both what you changed, and what has changed in the repository):

cvs diff -D "now" foo_mod.f

Merge your local file with the current repository version

cvs update foo_mod.f 

Obtain a fresh copy of a file in the repository (without merging)

rm foo_mod.f
cvs update foo_mod.f 

Difference between the local repository and the tagged version “TAGNAME”

cvs diff -r TAGNAME (< file name > for specific file)

Difference between the two tagged versions “TAGNAME1” and “TAGNAME2” in the repository (shows modified files only):

cvs diff -N -c -r TAGNAME2 -r TAGNAME2 | grep "Index:" > output.txt

Please do not use the commit command, which is restricted to the GCadj support team (Daven Henze and Nicolas Bousserez).