CVS Quick-Reference

Index of Topics

Basic CVS UseIntroducing the two CVS commands you need to get up and running with CVS.
FAQFrequently (and not so frequently) asked questions about specific procedures in CVS
LinksLinks to other CVS tutorials and FAQs

Basic Use

  1. The CVS files are stored in /afs/nickerson/sw/cvs. To use the repository, just set your CVSROOT environment variable to /afs/nickerson/sw/cvs:
    mwimpee@kaibigan 203% setenv CVSROOT /afs/nickerson/sw/cvs
    if you use tcsh or
    [mwimpee@kaibigan mwimpee]$ export CVSROOT=/afs/nickerson/sw/cvs
    if you use bash.

  2. Editing files should be done in a "sandbox"--some directory that houses only the CVS files you're working on. An easy way to do this is to create a sandbox folder in your home directory:
    mwimpee@kaibigan 208% cd
    mwimpee@kaibigan 209% pwd
    mwimpee@kaibigan 210% mkdir sandbox
    mwimpee@kaibigan 211% cd sandbox

  3. Once your sandbox is ready, simply check out the files you need. Here's an example of checking out the polyphred module:
    mwimpee@kaibigan 215% cvs checkout polyphred
    cvs checkout: Updating polyphred
    U polyphred/Makefile
    U polyphred/alignment.cpp
    U polyphred/alignment.h
    [some output removed]
    U polyphred/sudophred.cpp
    U polyphred/vector.h
    mwimpee@kaibigan 216%
    You should now have the source for polyphred in ~/sandbox/polyphred.

  4. Go forth and be productive.

  5. To add a file to CVS (test.txt for example), create the file and type
    cvs add test.txt
    You'll get a message that the file has been added to the repository and that you need to
    cvs commit
    for the change to take effect.

  6. When you're finished adding a feature or done working for the day, you need to commit your changes to the CVS repository. A simple
    cvs commit
    should do the trick. You'll be shown a screen like this:
    CVS: ----------------------------------------------------------------------
    CVS: Enter Log.  Lines beginning with `CVS:' are removed automatically
    CVS: Committing in .
    CVS: Modified Files:
    CVS:    ctime.cpp
    CVS: ----------------------------------------------------------------------
    CVS is telling me I've changed the file ctime.cpp. Just enter a description of your changes to the top of the file then save and exit the editor.