cvs — Concurrent Versions System
| Use Case | Command | Description |
|---|---|---|
| 📥 Check out sources | cvs checkout module | Create a working directory with source files from the repository. |
| 🔄 Update working copy | cvs update | Sync local files with latest repository revisions; merge changes. |
| 💾 Commit changes | cvs commit -m "message" | Permanent save of local changes to the repository. |
| 🔍 Show differences | cvs diff -u -r rev1 -r rev2 | Compare revisions (or working file vs. base). |
| 📜 View log | cvs log file | Display revision history, tags, dates, authors. |
| 🏷️ Tag files | cvs tag tagname [files] | Assign a symbolic name to a revision. |
| 🌿 Branch | cvs rtag -b branch_name module | Create a branch for parallel development. |
| 📤 Export sources | cvs export -r tag -d dir module | Copy sources without CVS administrative directories (requires tag/date). |
| 📋 List repository | cvs rls | List files/directories in the repository (tip of trunk). |
| 🧹 Release working copy | cvs release -d dir | Indicate checkout is abandoned, optionally delete directory. |
cvs [ cvs_options ] cvs_command [ command_options ] [ command_args ]
This manual page is a summary of parts of the cvs documentation and automatically generated from an appendix of the CVS manual (the Cederqvist), which is also the target of all cross‑references found in this manual page; please refer to the full CVS manual for more in‑depth documentation of the Concurrent Versions System.
If you're reading this manual page as part of the MirBSD online (HTML) manual pages archive, follow the cvs(GNU) link to the Cederqvist (and the cvsclient(GNU) link to the client/server protocol description, if necessary).
If you installed cvs via the Debian or MirPorts Framework package management systems:
/usr/mpkg/share/doc/cvs/cvs.pdf (MirPorts Framework)/usr/share/doc/cvs/cvs.pdf (Debian)are versions of the Cederqvist rendered as books, for printing and reading on screen.
If you have a Texinfo reader such as info installed, you can read the Cederqvist by entering: info cvs.
Quick introduction to info so you aren't immediately lost:
Other ways to read further documentation are described in the SEE ALSO section.
This appendix describes the overall structure of cvs commands, and describes some commands in detail (others are described elsewhere; for a quick reference to cvs commands, see node 'Invoking CVS' in the CVS manual, and for an alphabetical list of all cvs commands, see node 'CVS command list' in the CVS manual).
The overall format of all cvs commands is:
cvs [ cvs_options ] cvs_command [ command_options ] [ command_args ]
cvsThe name of the cvs program.
cvs_optionsSome options that affect all sub‑commands of cvs. These are described below.
cvs_commandOne of several different sub‑commands. Some commands have aliases; you may omit cvs_command only for cvs -H (list commands) and cvs -v (version info).
command_optionsOptions specific to the command.
command_argsArguments to the commands.
There is unfortunately some confusion between cvs_options and command_options. When given as a cvs_option, some options only affect some of the commands. When given as a command_option it may have a different meaning, and be accepted by more commands. In other words, do not take the above categorization too seriously. Look at the documentation instead.
cvs can indicate to the calling environment whether it succeeded or failed by setting its exit status. The exact way of testing the exit status will vary from one operating system to another. For example in a Unix shell script the $? variable will be 0 if the last command returned a successful exit status, or greater than 0 if the exit status indicated failure.
If cvs is successful, it returns a successful status; if there is an error, it prints an error message and returns a failure status. The one exception to this is the cvs diff command. It will return a successful status if it found no differences, or a failure status if there were differences or if there was an error. Because this behavior provides no good way to detect errors, in the future it is possible that cvs diff will be changed to behave like the other cvs commands.
There are some command_options that are used so often that you might have set up an alias or some other means to make sure you always specify that option. One example is that many people find the default output of the diff command to be very hard to read, and that either context diffs or unidiffs are much easier to understand.
The ~/.cvsrc file is a way that you can add default options to cvs_commands within cvs, instead of relying on aliases or other shell scripts.
The format of the ~/.cvsrc file is simple. The file is searched for a line that begins with the same name as the cvs_command being executed. If a match is found, then the remainder of the line is split up (at whitespace characters) into separate options and added to the command arguments before any options from the command line.
If a command has two names (e.g., checkout and co), the official name, not necessarily the one used on the command line, will be used to match against the file. So if this is the contents of the user's ~/.cvsrc file:
log -N
diff -uN
rdiff -u
update -Pd
checkout -P
release -d
the command cvs checkout foo would have the -P option added to the arguments, as well as cvs co foo.
With the example file above, the output from cvs diff foobar will be in unidiff format. cvs diff -c foobar will provide context diffs, as usual. Getting "old" format diffs would be slightly more complicated, because diff doesn't have an option to specify use of the "old" format, so you would need cvs -f diff foobar.
In place of the command name you can use cvs to specify global options. For example the following line in .cvsrc
cvs -z6
causes cvs to use compression level 6.
The available cvs_options (that are given to the left of cvs_command) are:
--allow-root=rootdirMay be invoked multiple times to specify one legal cvsroot directory with each invocation. Also causes CVS to preparse the configuration file for each specified root, which can be useful when configuring write proxies. -aAuthenticate all communication between the client and the server. Only has an effect on the cvs client. As of this writing, this is only implemented when using a GSSAPI connection. Authentication prevents certain sorts of attacks involving hijacking the active tcp connection. Enabling authentication does not enable encryption. -b bindirIn cvs 1.9.18 and older, this specified that rcs programs are in the bindir directory. Current versions of cvs do not run rcs programs; for compatibility this option is accepted, but it does nothing. -T tempdirUse tempdir as the directory where temporary files are located. The cvs client and server store temporary files in a temporary directory. The path to this temporary directory is set via, in order of precedence: the argument to the global -T option; the value set for TmpDir in the config file (server only); the contents of the $TMPDIR environment variable;/tmp. Temporary directories should always be specified as an absolute pathname. When running a CVS client, -T affects only the local process.
-d cvs_root_directoryUse cvs_root_directory as the root directory pathname of the repository. Overrides the setting of the $CVSROOT environment variable.
-e editorUse editor to enter revision log information. Overrides the setting of the $CVSEDITOR and $EDITOR environment variables.
-fDo not read the ~/.cvsrc file. This option is most often used because of the non‑orthogonality of the cvs option set.
-gForges group‑writable permissions on files in the working copy. This option is typically used when you have multiple users sharing a single checked out source tree, allowing them to operate their shells with a less dangerous umask at the expense of cvs security. (MidnightBSD extension merged into Debian and MirBSD cvs.)
-H / --helpDisplay usage information about the specified cvs_command (but do not actually execute the command). If you don't specify a command name, cvs -H displays overall help for cvs, including a list of other help options.
-RTurns on read‑only repository mode. This allows one to check out from a read‑only repository, such as within an anoncvs server, or from a cd‑rom repository. Same effect as if the CVSREADONLYFS environment variable is set. Using -R can also considerably speed up checkouts over NFS.
-nDo not change any files. Attempt to execute the cvs_command, but only to issue reports; do not remove, update, or merge any existing files, or create any new files. Note that cvs will not necessarily produce exactly the same output as without -n.
-QCause the command to be really quiet; the command will only generate output for serious problems.
-qCause the command to be somewhat quiet; informational messages, such as reports of recursion through subdirectories, are suppressed.
-rMake new working files read‑only. Same effect as if the $CVSREAD environment variable is set. The default is to make working files writable, unless watches are on.
-s variable=valueSet a user variable.
-tTrace program execution; display messages showing the steps of cvs activity. Particularly useful with -n to explore the potential impact of an unfamiliar command.
-v / --versionDisplay version and copyright information for cvs.
-wMake new working files read‑write. Overrides the setting of the $CVSREAD environment variable. Files are created read‑write by default, unless $CVSREAD is set or -r is given.
-xEncrypt all communication between the client and the server. Only has an effect on the cvs client. As of this writing, this is only implemented when using a GSSAPI connection or a Kerberos connection. Enabling encryption implies that message traffic is also authenticated. Encryption support is not available by default; it must be enabled using a special configure option, --enable-encryption, when you build cvs.
-z levelRequest compression level for network traffic. cvs interprets level identically to the gzip program. Valid levels are 1 (high speed, low compression) to 9 (low speed, high compression), or 0 to disable compression (the default). This option only has an effect when passed to the cvs client.
This section describes the command_options that are available across several cvs commands. These options are always given to the right of cvs_command. Not all commands support all of these options; each option is only supported for commands where it makes sense. However, when a command has one of these options you can almost always count on the same behavior of the option as in other commands. (Other command options, which are listed with the individual commands, may have different behavior from one cvs command to the other).
Note: the history command is an exception; it supports many options that conflict even with these standard options.
-D date_specUse the most recent revision no later than date_spec. The specification is sticky when you use it to make a private copy of a source file. -D is available with annotate, checkout, diff, export, history, ls, rdiff, rls, rtag, tag, and update. -fWhen you specify a particular date or tag to cvs commands, they normally ignore files that do not contain the tag (or did not exist prior to the date). Use -f if you want files retrieved even when there is no match for the tag or date. (The most recent revision of the file will be used). Note that even with -f, a tag that you specify must exist. -f is available with: annotate, checkout, export, rdiff, rtag, and update. WARNING: The commit and remove commands also have a -f option, but it has a different behavior for those commands. -k kflagOverride the default processing of RCS keywords other than -kb. Used with checkout and update, your kflag specification is sticky. -k is available with add, checkout, diff, export, import, rdiff, and update. -lLocal; run only in current working directory, rather than recursing through subdirectories. Available with many commands. -m messageUse message as log information, instead of invoking an editor. Available with add, commit and import. -nDo not run any tag program. (A program can be specified to run in the modules database; this option bypasses it). Note: this is not the same as the cvs -n program option. Available with checkout, commit, export, and rtag. -PPrune empty directories. -pPipe the files retrieved from the repository to standard output, rather than writing them in the current directory. Available with checkout and update. -RProcess directories recursively. This is the default for all cvs commands, with the exception of ls & rls. Available with many commands. -r tag or -r tag[:date]Use the revision specified by the tag argument (and the date argument for commands which accept it) instead of the default head revision. Special tags: HEAD (most recent version on trunk), BASE (revision you last checked out). The tag specification is sticky when used with checkout or update. As a Debian and MirBSD cvs extension, specifying BASE as the date portion yields the base revision of the branch. -r tag is available with commit and history. -r tag[:date] is available with annotate, checkout, diff, export, rdiff, rtag, and update. -WSpecify file names that should be filtered. You can use this option repeatedly. Available with import and update.Synopsis: cvs admin [options] [files...]
Requires: repository, working directory. Changes: repository. Synonym: rcs. This is the cvs interface to assorted administrative facilities. Some of them have questionable usefulness for cvs but exist for historical purposes. Some of the questionable options are likely to disappear in the future. This command does work recursively, so extreme care should be used.
On Unix, if there is a group named cvsadmin, only members of that group can run cvs admin commands, except for those specified using the UserAdminOptions configuration option in the CVSROOT/config file. Options specified using UserAdminOptions can be run by any user.
rev1::rev2 (collapse intermediate revisions), ::rev (collapse from branchpoint to rev), rev:: (collapse from rev to end), rev (delete rev), rev1:rev2 (delete inclusive range), :rev (delete from beginning to rev), rev: (delete from rev to end). None of the revisions to be deleted may have branches or locks. Use :: syntax to avoid deleting symbolic names.
-qRun quietly; do not print diagnostics.
-sstate[:rev]Set the state attribute of the revision rev to state. Useful with cvs. Common states: Exp, Stab, Rel. Note: cvs uses the dead state for its own purposes; use cvs remove and cvs add to change to/from dead.
-t[file]Write descriptive text from the contents of the named file into the RCS file, deleting the existing text.
-t-stringSimilar to -tfile. Write descriptive text from the string.
-USet locking to non‑strict. Not recommended for cvs.
-u[rev]Unlock the revision with number rev. Normally only the locker may unlock; somebody else unlocking breaks the lock.
-VnObsolete. Specifying it will produce an error.
-xsuffixesNever done anything useful for cvs.
Synopsis: cvs annotate [options] files... or cvs rannotate [options] files...
Requires: repository. Changes: nothing. For each file, print the head revision of the trunk, together with information on the last modification for each line. If backwards annotation is requested, show the first modification after the specified revision (backwards annotation currently appears to be broken).
$ cvs annotate ssfile
Annotations for ssfile
***************
1.1 (mary 27-Mar-96): ssfile line 1
1.2 (joe 28-Mar-96): ssfile line 2
The file ssfile currently contains two lines. The ssfile line 1 line was checked in by mary on March 27. Then, on March 28, joe added a line ssfile line 2, without modifying the ssfile line 1 line. This report doesn't tell you anything about lines which have been deleted or replaced; you need to use cvs diff for that.
Synopsis: cvs checkout [options] modules...
Requires: repository. Changes: working directory. Synonyms: co, get. Create or update a working directory containing copies of the source files specified by modules. You must execute checkout before using most of the other cvs commands.
$ cvs checkout tc
$ cvs checkout -D yesterday tc
Synopsis: cvs commit [-lnRf] [-m 'log_message' | -F file] [-r revision] [files...]
Requires: working directory, repository. Changes: repository. Synonym: ci. Use commit when you want to incorporate changes from your working source files into the source repository. If you don't specify particular files, all files in the current directory are examined. commit verifies that the selected files are up to date; it will notify you and exit without committing if any must be made current first with update. When all is well, an editor is invoked to enter a log message. You can specify the log message with -m or -F. At commit, a unique commitid is placed in the rcs file.
$ cvs rtag -b -r FCS1_2 FCS1_2_Patch product_module
$ cvs checkout -r FCS1_2_Patch product_module
$ cd product_module
[[ hack away ]]
$ cvs commit
$ cvs tag -b EXPR1
$ cvs update -r EXPR1
$ cvs commit
Synopsis: cvs diff [-lR] [-k kflag] [format_options] [(-r rev1[:date1] | -D date1) [-r rev2[:date2] | -D date2]] [files...]
Requires: working directory, repository. Changes: nothing. The diff command is used to compare different revisions of files. The default action is to compare your working files with the revisions they were based on. The exit status for diff is different than for other cvs commands (0 = no differences, 1 = differences, >1 = error).
Standard options: -D date, -k kflag, -l (local), -R (recursive), -r tag[:date]. Additionally, many format options are available (same as GNU diff):
-u (unified), -c (context), -e (ed script), -n (RCS format), -y (side by side)--ignore-space-change, --ignore-case, --ignore-blank-lines, etc.--old-group-format, --new-group-format, --changed-group-format, --unchanged-group-format for custom output$ cvs diff -kk -u -r 1.14 -r 1.19 backend.c
$ cvs diff -r RELEASE_1_0 -r EXPR1
$ cvs diff -c -r RELEASE_1_0 -r RELEASE_1_1 > diffs
$ cvs diff -u | less
Synopsis: cvs export [-flNnR] (-r rev[:date] | -D date) [-k subst] [-d dir] module...
Requires: repository. Changes: current directory. This command is a variant of checkout; use it when you want a copy of the source for module without the cvs administrative directories. Requires a date or tag. Often used with -kv to expand keywords for import elsewhere.
Synopsis: cvs history [-report] [-flags] [-options args] [files...]
Requires: the file $CVSROOT/CVSROOT/history (must be enabled via LogHistory config option). Changes: nothing. cvs can keep a history log that tracks each use of most cvs commands. You can use history to display this information in various formats.
Synopsis: cvs import [-options] repository vendortag releasetag...
Requires: Repository, source distribution directory. Changes: repository. Use import to incorporate an entire source distribution from an outside source into your source repository directory. The outside source is saved in a first‑level branch, by default 1.1.1. At least three arguments are required: repository, vendortag, and at least one releasetag.
Each file is preceded by one character: U (existing, new revision created), N (new file added), C (locally modified, need merge), I (ignored), L (symbolic link, ignored).
Synopsis: cvs log [options] [files...] or cvs rlog [options] [files...]
Requires: repository, working directory. Changes: nothing. Display log information for files. Output includes location of the rcs file, head revision, symbolic names, and for each revision: number, date, author, lines added/deleted, commitid, and log message. Dates are displayed in local time at the client.
$ TZ=UTC cvs log foo.c
$ TZ=EST cvs log bar.c
Synopsis: cvs ls [-e | -l] [-RP] [-r tag[:date]] [-D date] [path...] or cvs rls [-e | -l] [-RP] [-r tag[:date]] [-D date] [path...]
Requires: repository for rls, repository & working directory for ls. Changes: nothing. Synonyms: dir & list for ls; rdir & rlist for rls. By default ls lists the files and directories that belong in your working directory; rls lists the files and directories on the tip of the trunk in the topmost directory of the repository.
$ cvs rls
cvs rls: Listing module: `.'
CVSROOT
first-dir
$ cvs rls CVSROOT
cvs rls: Listing module: `CVSROOT'
checkoutlist
commitinfo
config
cvswrappers
loginfo
modules
notify
rcsinfo
taginfo
verifymsg
Synopsis: cvs rdiff [-flags] [-V vn] (-r tag1[:date1] | -D date1) [-r tag2[:date2] | -D date2] modules...
Requires: repository. Changes: nothing. Synonym: patch. Builds a Larry Wall format patch(1) file between two releases, that can be fed directly into the patch program. The diff output is sent to the standard output device.
$ cvs rdiff -c -r FOO1_2 -r FOO1_4 tc | Mail -s 'The patches you asked for' foo@example.net
$ cvs patch -s -r R_1_3_1 -r R_1_3fix module-name
Synopsis: cvs release [-d] directories...
Requires: Working directory. Changes: Working directory, history log. This command is meant to safely cancel the effect of cvs checkout. It checks that no uncommitted changes are present; that you are executing it from immediately above a cvs working directory; and that the repository recorded for your files matches the repository defined in the module database. If all conditions are true, it leaves a record in the history log.
Before release, it prints a one‑line message for any file that is not up‑to‑date: U/P (newer revision exists), A (added but not committed), R (removed but not committed), M (modified), ? (unknown file).
$ cd ..
$ cvs release -d tc
You have [0] altered files in this repository.
Are you sure you want to release (and delete) directory `tc': y
$
Synopsis: cvs pserver [-c path] or cvs server [-c path]
Requires: repository, client conversation on stdin/stdout. Changes: Repository or, indirectly, client working directory. The cvs server and pserver commands are used to provide repository access to remote clients and expect a client conversation on stdin & stdout. Typically these commands are launched from inetd or via ssh. server expects that the client has already been authenticated; pserver attempts to authenticate the client itself.
Synopsis: cvs suck module/pa/th
Requires: repository. Locates the file module/pa/th,v or module/pa/Attic/th,v and downloads it raw as RCS comma‑v file. Output consists of the real pathname of the comma‑v file, relative to the CVS repository, followed by a newline and the binary file content immediately thereafter.
Synopsis: cvs update [-ACdflPpR] [-I name] [-j rev [-j rev]] [-k kflag] [-r tag[:date] | -D date] [-W spec] files...
Requires: repository, working directory. Changes: working directory. After you've run checkout to create your private copy of source, other developers will continue changing the central source. From time to time, you can use the update command to reconcile your work with any revisions applied to the source repository since your last checkout or update. Without the -C option, update will also merge any differences between the local copy of files and their base revisions into any destination revisions specified with -r, -D, or -A.
Each file is preceded by a character: U (file brought up to date), P (patch applied), A (added to working copy, pending commit), R (removed, pending commit), M (modified/merged successfully), C (conflict detected), ? (unknown file).
The most comprehensive manual for CVS is Version Management with CVS by Per Cederqvist et al. (see NOTE at top).
For CVS updates, more information on documentation, software related to CVS, development of CVS, and more, see:
http://www.nongnu.org/cvs/
Manual pages: ci(1), co(1), cvs(5), cvsbug(8), diff(1), grep(1), patch(1), rcs(1), rcsdiff(1), rcsin‑tro(1), rcsmerge(1), rlog(1), re_format(7).
Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-18 14:51 @216.73.217.6
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)