home > cvs > cvs quick reference

CVS Quick Reference

To view the revision history of a file:

crb% cvs log myFile.php

To see the status of local files in a compact format, without actually doing an update:

crb% cvs -n -q update

(to see the status in verbose format use cvs status)

To commit changes to a load of files simultaneously, while in the checked out project directory:

crb% cvs ci -m “made some changes”

(basically, if no files are specified, the commit affects all changed files in the current directory and subdirectories). ci is shorthand for commit.

Or you can specify several files to commit, while in the checked out project directory:

crb% cvs ci -m “made some more changes” header.php footer.php search.php

To add a new directory to an existing project, while in the checked out project directory:

crb% mkdir subfolder1
crb% cvs add subfolder1

To see what files have changed from a certain date:

crb% cvs history -c -D 02/22/2004

( -c means show commits. -D is the date (in US format) from which you want to see commits)

To update a working copy with changes commited to the central repository, from the root of the working copy:

crb% cvs update

To update a working copy and add any new directories that have been added and commited to the central repository:

crb% cvs update -d

To remove a working copy, change to the parent directory of the working copy and:

crb% cvs release -d someProject

This will check whether you have modified anything without commiting and and ask you to confirm before removing the directory.

To move a file to a different directory, first mv the file, then cvs remove it from the old location, then add it to the new, then commit:

crb% mv old/code.php new/code.php
crb% cvs remove old/code.php
crb% cvs add new/code.php
crb% cvs ci -m “moved code from old to new” new/code.php old/code.php

To tag the current version of all files with a release name / number, from the root directory of the working copy:

crb% cvs -q tag Release-1-0-2a

Note: the release tag can only contain numbers, letters, dashes and underscores (no spaces or other punctuation).

To check out a working copy of a specific release:

crb% cvs checkout -r Release-1-0-2a someProject