Harvey Mudd College
2000 - 2001
Computer Science Clinic Project
sponsored by Yahoo!, Inc.
Using CVS
Getting Started
- Edit your shell resource file (e.g. .tcshrc) to contain the following lines:
setenv CVSROOT /usr/yahoo/cvsroot
setenv EDITOR emacs
Feel free to replace emacs with your favorite editor in the second line. However,
if you don't specify an editor, the default (vi on our system) will be launched by
CVS when it comes time to commit changes to the repository.
- Create a directory in which you want to keep your copy of the source code. Do
something like:
mkdir dev
cd dev
- Execute the following command from within your newly created directory:
cvs checkout calendar
- You should now have a directory called 'calendar'. Within it are your own
copies of the latest calendar source code. One special thing to note is that
there is a directory called 'CVS' within the calendar directory. Don't touch
this (CVS uses it for keeping track of things). Now, you can edit your own
copies of the source without worrying about other people changing it.
Updating Your Code
- Since you checked out your copy of the code, other developers may have
committed changes to the repository. To bring your code up to date with their
changes, execute the following command:
cvs update -dP
- You may see one of the following symbols in front of one or more filenames:
U - your file was brought up to date
A - you added this file to your source
M - you made changes to this file (CVS may have brought it up to date)
C - you made changes to this file (CVS could not bring it up to date)
? - CVS knows nothing about this file
Committing Changes
- Assuming your changed a file called 'filename', execute the following
command to commit your changes to the CVS repository:
cvs commit filename
- CVS will then launch your editor so you can enter comments about what changes
you made to this file and why. These comments are helpful to other developers
to know what has changed in the source code, when, why, and by whom. You can
review the comments by executing:
cvs log filename
- If you make changes to several files and you would like to commit them all
at once, just run:
cvs commit
However, you will only be allowed to enter one set of comments for all the files
you changed. This should be avoided so you can enter more specific comments for
each file.
Adding/Removing Files
- To add/remove a file called 'filename' to the CVS repository run:
cvs add filename
or
cvs remove filename
- Then, run:
cvs commit