I have switched to Subversion for my own use. But still might need CVS on other projects.

CVS

CVS is a tool for tracking and rolling back changes to text files. Version control is useful for the source of documents or code, and also allows multiple developers to work on a project.

This page is a copy of my paper notes on CVS. Everything else (that I use) is either answered by a quick look at the CVS refcard or needs a detailed rereading of the manual.

The CVS manual is rather fat and daunting. It is worthwhile using CVS though, and to understand it you’ll at least want to skim read the introductory parts. Then create a repository and start a new project as below. You can learn the rest as and when you need it.

These “To-The-Point Instructions for Using CVS” by Bradley C. Kuszmaul might be useful.

Create a personal repository

cvs -d $HOME/cvsrep init

Then put a line in your shell’s rc file:
sh-like shells: export CVSROOT=$HOME/cvsrep
csh-like shells: setenv CVSROOT=$HOME/cvsrep
and restart your shell.

Starting a new project

It is easiest if you create a directory structure (contained within progdir, say) first. Then import it into the tree:

cd progdir
cvs import yourname/progname yourname start

You should replace progdir, yourname and progname to match your code’s location, your name and the name of your project.

You should then move progdir to a backup folder and never use it again. To get a copy of the program that you can work on from the repository, do:

cvs checkout yourname/progname

and then every so often tell the repository about your changes:

cvs commit

in the directory containing your project. When you create new files you’ll need to “cvs add” them. Don’t add files that can be exactly reproduced from other source files.

Define a module

This allows you to refer to progname rather than yourname/progname.

cvs checkout CVSROOT/modules
cd CVSROOT
echo 'progname yourname/progname' >> modules
cvs commit modules
cd ..
cvs release -d CVSROOT