CS121 Software Development

CVS Initialization Tutorial

CVS is a version control system that allows you to manage your project files. You create a central repository. Team members can checkout files, modify them, then check them back into the repository. When a file is checked in, it is checked for consistency with the current version. If need be, you can recover an old version of a file. These notes describe how to set up CVS for your team. This should be done once per team. The notes on using CVS after it is initialized are here.
  1. Login to Turing and create the directory /cs/cs121/year/semester/teamj/CVS. For example, if you are part of team4 in the spring of 2004 you would execute the following commands:
    cd /cs/cs121/2004/spring/team4
    mkdir CVS
    
  2. Change the group ownership of the CVS directory to 121teamj. Continuing with the previous example you'd execute the following:
    chgrp 121team4 CVS
    
  3. Change the directory persmissions of CVS to allow group read/write/execute and to set the sticky bit:
    chmod 770 CVS
    chmod g+s CVS
    
  4. Now set your CVSROOT environment variable to the CVS directory. Continuing the previous example you'd execute the following:
    setenv CVSROOT /cs/cs121/2004/spring/team4/CVS
    
  5. Now initialize the repository as follows:
    cvs init
    
  6. Now import a directory into the repository. Suppose you have a directory called ~/cs121/proj1 (in your home directory) set up for the first project. To import the proj1 directory and all of its contents do the following.
    cd ~/cs121/proj1
    cvs import code yes ok
    
    You will be dropped into an editor to provide comments for your current action. Add comments "creating project 1 directory" then exit the editor. You should see a sequence of messages adding the files in code to the repository.

  7. Now examine the directory:
    cd /cs/cs121/year/semester//teamj/CVS
    ls -al
    
    You should find the CVS/proj1 directory with group set to 121teamj and group read/write/execute permission. The original directory structure should be replicated but with the appropriate group ownership/permissions.