Most commonly-used CVS commands

 

Conventions

green: These are generic user-supplied things

[ ] :optional things

files: This may be replaced by a - single filename

                                                     - a space-separated list of filenames

                                                     - or an expression involving wildcards (usually).

______________________________________________________________________________________________________________________________

Commands

cvs checkout [-d dir -r tag] module-name
 
The command will create the (optional) specified dir if it doesn't already exist. -r will check out the specified tagged version. Typically if you expect to be developing in the package, you want the HEAD, in which case you should omit the -r option.
cvs add [-m "multi-word msg" ] files
 
Add new files to be maintained in the repository. May also add a directory this way. You still need to do a commit. add just marks the files as being commitable. Unlike most other commands, add does not act recursively on directories, so adding a directory does not add the files contained by the directory. Use the CVS import command for this kind of thing.
cvs commit [-m "multi-word msg" ] [files]
 
Works recursively on directories. If no files are specified everything reachable from current directory which is newer than the version in the repository will be committed. If there is anything in the repository which is newer than the copy in your working directory, CVS will refuse to do anything until you issue a CVS update (q.v.) If no message is supplied on the command line, CVS will bring up your editor.
cvs [-n] update
 
Compare working directory to the versions of the same files in the repository. If you have not changed a file but there is a newer version in the repository, CVS will replace your local copy with the repository version. If both files (copy in your working directory and in repository) have changed since you checked out the file, CVS will attempt to merge them. Under some circumstances it will complain that there is a conflict.
In order not to be unpleasantly surprised, it's often best to issue the command with the -n flag first. CVS will tell you about any changes it would make without actually making them. Each file which has changed somewhere since you checked it out is mentioned in the output with a code letter to tell you what action CVS plans to take. Here is some sample output:

   

	jrb@noric06 $ cvs -n update
	cvs update: Updating .
	U ChangeLog
	cvs update: Updating calibUtil
	M calibUtil/Metadata.h
	cvs update: Updating cmt
	M cmt/requirements
	cvs update: Updating doc
	? doc/CALcal.txt
	cvs update: Updating src
	? src/Metadata.cxx
	? src/.mysqlopt.cnf
	cvs update: Updating xml
	cvs update: Updating xml/test

U   : means the file is newer in the repository; your copy will be replaced by the repository version.

M  : means you have made changes, but CVS believes it can successfully merge them with changes, if any, to the         repository version.

?    : means the file doesn't exist in the repository but is not on the list of things you've asked CVS to ignore (with a         file called .cvsignore). This is not necessarily an error, but if you think the file should be in the repository,            you should do an add.

P    : essentially the same as U, but file is just patched instead of being entirely rewritten.

C    : which means both your working version and the repository version have changed and CVS doesn't know           how to merge them.

A    : means you've issued an add command but haven't yet committed the new files                                                R    : is similar, but for removed files.

 
cvs remove [-f -l -R] files
 
Like add, remove is an instruction to CVS to mark the file for removal. There are actually three steps involved.
  1. Get the file out of the working directory (e.g., rm)
  2. Issue the CVS remove command
  3. Do a CVS commit of the file
You can do 1. and 2. together with the -f option. By default, the command acts recursively on directories (-R option). To force it to operate only on the local directory, use the -l option.
cvs rtag tagid modules
 
Tags repository current revision of source files in the module(s). In general is to be preferred to cvs tag, which uses working directory versions of files.

______________________________________________________________________________________________________________________________

 

Back to installing CVS