Setting up and using CVS

Setup steps

  1. You will need a client for SSH. For Windows, SSH Secure Shell is a good tool. There are plenty others. Let the web be your oyster.
  2. Download the CVS client for your OS. Be sure that the file is executable from the command shell (for Windows, this means that you must add the directory in which CVS.exe sits to your PATH environment variable).
  3. Windows users: Download and install Cygwin. You will need this to emulate the UNIX shell so that you can connect to the CVS repository with appropriate authentication credentials. You will run the Cygwin bash shell to use CVS.
  4. Open up your shell. Change to the directory from which you wish to store your CS212 files. You will need to set the UNIX environment variable CVS_RSH so that CVS will know where to find your SSH client. For example:

    $ CVS_RSH=ssh2; export CVS_RSH

  5. Now, you will be able to access the CVS repository. Enter the following command to check out the CS212_GBA project:

    $ cvs -d :ext:<your_netid>@cvs.csuglab.cornell.edu:/cvsroot checkout -P CS212_GBA

    You will be prompted for your CU NetID password. Once you successfully authenticate, the project will be downloaded to your working directory.

Congratulations! You now have a working CVS configuration on your system.

Some useful CVS commands

Command Description Usage Example
checkout Check out a directory, pruning all directories not containing any files cvs checkout -P CS212_GBA
add* Add a file or directory to source control cvs add Mario.c
remove* Remove a file or directory** from source control cvs remove Koopa.c
update Update your local copy of a file or directory (nonconflicting changes are merged) cvs update Mario/sprites
commit Commit a series of local changes to source control cvs commit -m "fixed bug in collision detection" Mario.c
annotate Show the authors and comments for all revisions to a file or directory. cvs annotate Mario.c

* A file is not actually added or removed until you commit the change.
** A notable limitation of CVS is that directories actually cannot be removed from source control.

This is just a small sample of CVS' functionality. There are other commands that you may find useful.

Also note that you can set the environment variable CVSROOT to :ext:<your_netid>@cvs.csuglab.cornell.edu:/cvsroot to avoid having to include the -d switch each time.

Graphical CVS Clients

A number of graphical clients for CVS are available. They can be a useful tool. For Windows, we recommend TortoiseCVS. If you choose to use Eclipse for development, there is also an integrated CVS tool.