CVS ("Concurrent Versions System") is a version control system for software development projects. It allows you to keep change histories on individual source files, and to tag a particular snapshot of all files as belonging to the same release. It also supports other operations useful in the context of team programming.

CVS is part of the GNU Project and is freely distributed in the open source community. (GNU does many commonly used UNIX utilities like emacs, make, gcc, and gdb. See their "Free Software Directory" for a complete list.)

Why use CVS?

CVS solves a number of problems in the context of software development.

Some basic commands

Here are a few commands to give you an idea of how to use CVS. This list is hardly complete, but is meant simply to illustrate several typical operations. (See the links in the next section for a more detailed treatement of CVS commands.)

First, set your environment variable to your CVS repository directory. This is where CVS will store source files, differences, version information, etc.

setenv CVSROOT=mycvsrootdir

To create a source repository, cd to your source directory and use:


Once a repository is created, you can cd to any directory and "checkout" the source tree. This will copy it into your directory.

cvs checkout [-r REV] [-d DIR] MODULE

To add source files to a project:

cvs add -m MESSAGE file1 file2 file3

Remember that "checkout" in CVS means copying a source tree into your current working directory. Unlike some other source control systems, there is no concept of checking a file out before working on modifications in CVS. Instead, you simply make the modifications, and then "commit" the changes using:

cvs commit

To create a snapshot, you tag all files in the module:

cvs tag TAG_NAME

To look at a file's history:

cvs history file1

Useful CVS Links

GNU CVS manual
One of many online tutorials
CVS FAQ page written by UNC's DiRT research group

David Ott (
Last modified: 12 August 2002