Small CVS User Guide
This is just a guide for those who want to use CVS for the first time, or that may have forgotten some CVS commands. If you really want to take advantage of all CVS power, take a look at the CVS home page.
The CVS most commonly used commands are:
1. Download a module
Nowadays tol-project has the next modules avaliable: tol, toltcl, tolbase and toldoc.
To download any of them you need to use the checkout command:
The -r option tells the CVS which revision to download. If no -r option is given, then the main HEAD will be downloaded.
To download the branch called TOL-REL-1-1-5_BRANCH_20070220 of the module tol use the following command:
2. Download an entire sub-directory within a module
Under some circumstances you might want to work with certain module's sub-directories.
To download only certain directories within a module you need to use the -l option, so that you will only download the files directly hosted under that directory.
cvs -z4 co -l tol/bdat
The first command downloads the root directory contents of the tol module, but with no recursivity. The second command will download the bdat directory and will store it under the tol/bdat directory.
3. Downloaded code update
The source code you download from the CVS might be beeing modified by another member of the Tol Development Team.
The modified source code, after being tested is sent to the repository. You have another command to update the source code you downloaded:
If you are on the directory you want to update, you don't need to specify it:
The -P option forces all empty directories to be deleted. The -d option forces all new directories in the CVS to be created locally.
4. Save changes to the repository
To save the changes to the repository so that they will be avaliable for all CVS users, you have to use the commit command:
Where filename is the file name we are posting into the CVS. Of course, you can save a file list using just a sentence:
Once the command has been executed you will be asked for a short description of the changes you are saving into the CVS. All changes MUST have a short description of all changes. You can specify the description directly in the CVS command:
Important:
Please remember that the commits must allways include an english description. Otherwise that work would have to be done by the administrators, and they probably will cancel all your changes and ask you for the complete command.
You can set the environmental variable EDITOR or CVSEDITOR pointing to your favourite text editor to be called when asking for the description.
5. Adding a file
Adding the file filename.cpp to the directory dir:
cvs add filename.cpp
cvs commit -m "explanatory comment" filename.cpp
Until the cvs commit command is executed, the new file will not be avaliable on the CVS repository.
6. Removing a file
Removing the filename.cpp from the dir directory:
rm filename.cpp
cvs remove filename.cpp
cvs commit -m "explanatory comment"
7. Adding a directory
If you need to add a file to the repository but this file is under a new directory called dirname, follow this steps:
cd dirname
cvs add filename.cpp
cvs commit -m "explanatory comment"
Note that you can not add an empty directory into the CVS.
8. Removing a directory
To remove a directory from the repository you must first remove all it's contents:
rm filename.cpp
cvs remove filename.cpp
cvs commit -m "explanatory comment"
Now remove the file filename.cpp as explained above, and remove the directory afterwards:
cvs update -d -P
The last command will remove locally the dirname directory.
9. Save user preferences
The CVS offers the posibility of saving the most used options in a resource file, ~/.cvsrc. We recommend using the next values in that file:
diff -u
update -dP
checkout -P
The first line indicates that the -z4 option (fourth level compression) will be applied every time the cvs command is used.
The second line forces the cvs diff output to be unidiff-compilant, easier to parse than the standard output.
The -dP options forces to update the directory tree when updating
The -P option indicates that empty directories will not be downloaded.

