This page was last modified: July 27 2006 16:21:03   
Too Cool for Internet Explorer

CVS commands

The first time you login to the CVS repository, you must use your username and password

cvs -d :pserver:username@example.com:/path/to/repository

When issuing the above command you'll be asked for the password. This generates a file called .cvspass in your home directory. In the future when executing cvs commands, this file will be used to log you on, so that you wont have to give your username, password and repository location.

Set the CVSROOT variable - for the bash shell, this would be:

export CVSROOT=:pserver:username@example.com:/path/to/repository

You are now ready to do cvs stuff.

Basic concepts

Repository Stores a complete copy of all the files and directories which are under version control.
Modules A convenient way of grouping together related files and directories.
Branch Allows you to isolate changes onto a separate line of development. When you change files on a branch, those changes do not appear on the main trunk or other branches.
Revision The version number for a specific file
Release The version number for a complete project/software
Tag A symbolic name for a certain revision of a file

Frequently used commands

NOTE: All commands are recursive by default

cvs checkout -P module_name Checkout all files from a specific module, except empty directories
cvs checkout -r branch_name -P module_name Checkout everything in a module from a specific branch, except empty directories
cvs update file_name Issue an update of af specific file
cvs update -dP Update and create any missing files/directories and discards empty directories
cvs update -dPr tag_name _file_name_ Same as above but with the additional -r sticky option to get a specific tag
cvs -Q tag tag_name Set a tag quietly (always do this in the top directory of a module)
cvs commit file_name Commit a changed file

Less frequently used commands

rm file_name
cvs remove file_name
cvs commit file_name
Remove a file
mkdir dir_name
cvs add dir_name
cvs commit dir_name
Add a new folder (note that you must also commit any files in the folder)
create a file
cvs add file_name
cvs commit file_name
Add a new file
cvs diff -r branch_name -r HEAD file_name See difference between a specific file in a branch and main (HEAD)

Tip: How to verify that a specific tag is set

cvs -Q status -v | grep tag_name

tag_name (revision: 1.2.24.1)
tag_name (revision: 1.2.66.1)
tag_name (revision: 1.4.22.1)
tag_name (revision: 1.4.22.1)
tag_name (revision: 1.3.22.1)
tag_name (revision: 1.16.4.2)
...

If a list of tags appear (like in the example above) the tag is set and you can stop it with [CTRL]+[C]