CS121 Software Development

CVS Tutorial (Turing)

Concurrent Version Control (CVS) is a system for managing project files during development. You create a central repository for your files. Team members can checkout files, modify them, then check them back in. CVS stores your modifed file as the latest version, while preserving the previous one. If need be, you can restore an old version of the file.

Before using CVS, one member of your team should set up the repository. Instructions are provided here.

You can access the CVS repository from your Turing account or from a windows box using Tortoise CVS. These notes describe using CVS on Turing. For more info on Tortoise CVS look here.

You should keep (at least) your source code and documents under CVS. You probably don't want to keep object and executable files (or visual studio project files) since they are easily recreated and because CVS doesn't always handle these files correctly.



Before using the repository you need to do two things:

  1. You need to declare the repository you'll use. From the command line issue the command
    	setenv CVSROOT /cs/cs121/year/semester/teamj/CVS
    
    where year is the current year (e.g. 2004), semester is the current semester (i.e. spring or fall), and teamj is your team (e.g. team4). To verify the directory has been declared correctly issue the following command from the command line.
    	echo $CVSROOT
    
    To avoid having to issue the command every time you logon to Turing you can add the setenv command to your ~/.cshrc file.

  2. The next thing you have to do is create your own copy of the repository files. Suppose your cvs repository contains a directory called proj1 and you want to copy this directory to your directory ~/cs121. You'd issue the following commands
    	cd ~/cs121
    	cvs checkout proj1 
    
    The contents of the directory /cs/cs121/year/semester/teamj/CVS/proj1 will be copied to ~/cs121/proj1
Once you've followed these steps you can modify your files and check them back in, checkout new versions of files, and add new files to or remove existing files from the repository. To explain how to do these things, we'll continue with the previous example.