Marco Colombo

Experimental area · proceed at your own risk!

Some hints for CVS

Starting CVS

Add the following line in .bashrc
export CVSROOT=~/CVS
Create the directory CVS
cd ~
mkdir CVS
Initialise the CVS repository
cvs init

Importing an existing project

Move inside the project directory
cd Project
cvs import -m "Initial import." PROJECT user start
Remove the project directory
cd ..
rm -rf Project
Define a module for the new project
cvs checkout CVSROOT/modules
cd CVSROOT
Edit the modules file adding the following line at the end
project PROJECT
Commit this change
cvs commit -m "Added the project module." modules
cd ..
cvs release -d CVSROOT

Adding and removing files

To add a file
cvs add file
If the file contains binary data, specify -kb
cvs add -kb file
Commit the addition
cvs commit -m "Added file." file
To remove a file
rm file
cvs remove file
Commit the removal
cvs commit -m "Removed file." file

Tagging

It's possible to add a tag, so to have a symbolic name that references the current state of the repository
cvs tag release-1_0 file
To remove a tag
cvs tag -d release-1_0 file

Personal preferences

The file .cvsrc in the home directory can be used to set options to commands. For example, to obtain unified diffs that show which C function the changes are in, add this line
diff -u -p

Highlights

Links

2005, 2006, 2007 © marco