info > rcs

๐Ÿ“˜ NAME

GNU RCS โ€” Revision Control System (version 5.10.1, 27 January 2022)

๐Ÿš€ Quick Reference

Use CaseCommandDescription
๐Ÿ“ฅ Initial checkinci f.cCreate RCS file, store working file as revision 1.1, delete working file
๐Ÿ“ค Checkout latest revisionco f.cExtract latest revision and write to working file
๐Ÿ”’ Checkout and lock for editingco -l f.cCheckout with lock so only you can check in changes
๐Ÿ” Compare working file with latest revisionrcsdiff f.cShow differences between working file and most recent revision
๐Ÿ“ฅ Checkin with lockci -l f.cCheckin and immediately checkout locked to continue editing
๐Ÿ“ฅ Checkin with unlockci -u f.cCheckin and checkout unlocked for reading
๐Ÿ”“ Lock latest revisionrcs -l f.cLock the latest revision for yourself
๐Ÿ”“ Unlock revisionrcs -u f.cUnlock a revision
๐Ÿšซ Disable strict lockingrcs -U f.cAllow owner to checkin without lock
๐Ÿ”’ Enable strict lockingrcs -L f.cRequire lock for all users
๐ŸŒฟ Start a branchci -r1.3.1 f.cStart branch at revision 1.3, assign number 1.3.1.1
๐Ÿ“‹ Display RCS file inforlog f.cShow log messages, revisions, and metadata
๐Ÿ” Find keywords in filesident f.cScan for RCS keywords like $Id$
๐Ÿงน Remove unchanged working filesrcsclean f.cRemove working files that haven't been modified
๐Ÿ”€ Merge revisions into working filercsmerge f.cIncorporate changes between two revisions

๐Ÿ“– Overview

GNU RCS manages multiple revisions of files. It stores, retrieves, logs, identifies, and merges revisions. Useful for files revised frequently: programs, documentation, graphics, papers. Handles text and binary files (reduced functionality for binary).

Commands: ci, co, ident, merge, rcs, rcsclean, rcsdiff, rcsmerge, rlog. These are small and fast, suitable for scripting. Also includes script rcsfreeze.

RCS works with versions stored on a single filesystem, edited by one person at a time. For distributed access, see Bazaar, CVS, Subversion, Git.

๐Ÿ† Credits

RCS designed and built by Walter F. Tichy (Purdue University) - version 3 released 1983. Version 4.3 (1990) supported by Adam Hammer, Thomas Narten, Daniel Trinkle. Guy Harris contributed porting fixes. Paul Eggert contributed bug fixes and tuneups. Jay Lepreau contributed 4.3BSD support. Paul Eggert wrote changes for RCS 5.5/5.6 (1991). Rich Braun, Andy Glew contributed ideas for new options. Bill Hahn contributed setuid support. Joe Berkovitz and Walter F. Tichy contributed piece table ideas. Matt Cross contributed test case ideas. Adam Hammer QAed. Paul Eggert wrote most changes for RCS 5.7. K. Richard Pixley contributed bug fixes. Robert Lupton, Daniel Trinkle contributed '$Name' expansion. Brendan Kehoe suggested rlog '-N' option. Paul D. Smith suggested improvements. Thien-Thi Nguyen modernized code base, build system, manual pages for RCS 5.8, added standard '--help', '--version', wrote this documentation.

๐Ÿง  Concepts

๐Ÿ”„ Interaction Model

For each working file, you initialize its RCS file once, then cycle: checkout, modify, checkin. You can also tweak metadata. Analogous to a library: sign up (initialize), take book home (checkout), enjoy (without modification), return (checkin). You can compare revisions, examine descriptions, merge revisions.

๐Ÿ“„ Working File

The file you edit (e.g., a.c). Contents can be extracted from RCS file (instantiating a working file). Can be deleted to save disk space.

๐Ÿ—„๏ธ RCS File

Separate file, conventionally in RCS subdirectory. Organizes initial and subsequent revisions, each with a unique revision number and checkin particulars. Contains a description of the working file and metadata. Also known as "comma-v file" due to name ending in ,v (e.g., a.c,v).

Revision number: branch number + dot + integer. Branch number is odd number of integers separated by dot. Revision with one dot is on the trunk. All integers positive. Example: 1.1 (trunk), 9.4.1.42 (branch). Branch point of non-trunk branch: remove trailing integer. Next higher: add one to trailing integer. Highest-numbered revision on a branch is the tip.

RCS file tracks: default branch, symbolic names (associations between symbol and revision number). Access control policy: list of usernames (if non-empty, only those can modify); list of locks (username:revision) - if lock exists, only that user can modify that revision.

โš™๏ธ Fundamental Operations

Checkin: records working file contents, assigns new revision number, records username, timestamp, state, and log message. Uses diff to find differences. Checkout: identifies revision, displays to stdout or instantiates working file, may undergo keyword expansion ($Keyword$ replaced with value).

๐Ÿ”‘ Keywords

๐Ÿš€ Quick Tour

Put file f.c under RCS:

mkdir RCS
ci f.c

Creates RCS file in RCS, stores as revision 1.1, deletes f.c. Prompts for description.

Get back working file:

co f.c

Extracts latest revision. To edit, lock as you checkout:

co -l f.c

After editing, see differences:

rcsdiff f.c

Checkin back:

ci f.c

If ci complains "no lock set by your name", use:

rcs -l f.c

To avoid working file deletion during checkin, use:

ci -l f.c   # checkin + locked checkout
ci -u f.c   # checkin + unlocked checkout

To assign a specific revision number:

ci -r2 f.c
ci -r2.1 f.c

Retrieve specific revision:

co -r2 f.c
co -r2.1 f.c

Start a branch at revision 1.3:

ci -r1.3.1 f.c

Diagram:

1.1  --  1.2  --  1.3  --  1.4  --  1.5
                    |
                 [1.3.1]  --  1.3.1.1

๐Ÿ”ง Usage

All RCS commands accept '--help' and '--version'. Options are '-LETTER[ARG]', no space between letter and argument. Options must appear before file names. Pairs of RCS and working files can be specified in three ways: both given, only working file, only RCS file. If only working file, RCS commands look first in ./RCS directory.

๐Ÿงฉ Common Elements

๐Ÿ”ข Revision Options

Form '-FLAG[REV]'. REV can be:

For range: syntax 'REV1:REV2'.

๐Ÿ“… Date Option

Option '-dDATE' to specify date with second resolution. Accept '-zZONE' for timezone, 'LT' for local time. Many date formats recognized. Default timezone is UTC unless overridden by '-z'. Example dates:

8:00 pm lt
4:00 AM, Jan. 12, 1990           default is UTC
1990-01-12 04:00:00+00           ISO 8601 (UTC)
1990-01-11 20:00:00-08           ISO 8601 (local time)
1990/01/12 04:00:00              traditional RCS format
Thu Jan 11 20:00:00 1990 LT      output of ctime(3) + LT
Thu Jan 11 20:00:00 PST 1990     output of date(1)
Fri Jan 12 04:00:00 GMT 1990
Thu, 11 Jan 1990 20:00:00 -0800  Internet RFC 822
12-January-1990, 04:00 WET

Other date-only formats: YEAR-DOY (e.g., 2018-110), YEAR-wWEEK-DOW (e.g., 2018-w16-5).

๐Ÿ“ Description Option

Option '-t-TEXT' or '-tFILE-NAME' to set/update RCS file description.

๐Ÿ”ฃ Substitution Mode Option

Option '-kSUBST' controls keyword expansion. SUBST values:

๐Ÿ“ Log Message Option

Option '-mMSG' for ci and rcs. If MSG empty, uses '*** empty log message ***' (filtered by rlog).

๐Ÿท๏ธ State Option

Option '-sSTATE' to specify state. Default is 'Exp'. Other common states: 'Rel', 'Prod', 'Stable'. State should be an identifier.

โฑ๏ธ Working File mtime Option

Option '-M' or '-MREV' works with '-u' or '-l' to set working file modification time to date of revision REV (defaults to branch tip). Useful when working file is a Makefile prerequisite.

๐Ÿ”ง Misc Common Options

๐Ÿ“‹ Delim-separated List

Some options accept multiple items separated by delimiters (comma, space, tab, LF, etc.). Context-specific delimiters are listed in the manual.

๐ŸŒ Environment

๐Ÿ’พ ci (Checkin)

rcs ci [options] file ...
(or "ci" instead of "rcs ci")

Adds a revision to the RCS file reflecting current state of working file.

๐Ÿ“ฅ co (Checkout)

rcs co [options] file ...
(or "co" instead of "rcs co")

Retrieves a revision from the RCS file, writing a new working file.

๐Ÿ” ident

ident [options] [file ...]

Scans files for RCS keywords and displays them. If no file, scan stdin.

Also recognizes Subversion 1.2+ keyword patterns: $KEYWORD:: TEXT $ and $KEYWORD:: TEXT#$.

๐Ÿ”€ merge

merge [options] receiving-sibling parent other-sibling

Combines differences between parent and other sibling, and parent and receiving sibling. Writes result to receiving sibling.

๐Ÿ”ง rcs (Administration)

Two usages: modern (RCS 5.9.0+) and legacy.

Modern

rcs [options] command [command-arg ...]

Legacy (frob)

rcs frob [options] file ...
(or "rcs" instead of "rcs frob")

๐Ÿงน rcsclean

rcs clean [options] [file ...]
(or "rcsclean" instead of "rcs clean")

Removes working files that are not being worked on. With '-u', also unlocks and removes if unchanged. If no file, operate on all working files in current directory.

๐Ÿ“Š rcsdiff

rcs diff [options] file ...
(or "rcsdiff" instead of "rcs diff")

Runs diff to compare two revisions in an RCS file.

Additional options (and their arguments) are passed to underlying diff: -0..-9, -B, -C, -D, -F, -H, -I, -L, -U, -W, -a, -b, -c, -d, -e, -f, -h, -i, -n, -p, -t, -u, -w, -y, long options (--...)

๐Ÿ”€ rcsmerge

rcs merge [options] file
(or "rcsmerge" instead of "rcs merge")

Incorporates changes between two revisions into the working file.

๐Ÿ“‹ rlog

rcs log [options] file ...
(or "rlog" instead of "rcs log")

Displays information about RCS files.

๐Ÿ› ๏ธ Hacking

This chapter describes aspects of RCS interop with other programs, development ideas and methods.

๐Ÿ“ File Format

RCS file contents described by grammar below. Format is free-format text. Uses ISO 8859/1 encoding: visible graphic characters 041-176 and 240-377, whitespace 010-015 and 040.

๐Ÿ“ comma-v Grammar

rcstext   ::=  admin {delta}* desc {deltatext}*

admin     ::=  "head"         {num} ";"
               { "branch"     {num} ";" }
               "access"       {id}* ";"
               "symbols"      { sym ":" num }* ";"
               "locks"        { id ":" num }* ";"
               { "strict" ";" }
               { "integrity " {intstring} ";" }
               { "comment"    {string} ";" }
               { "expand"     {string} ";" }

delta     ::=  num
               "date"       num ";"
               "author"     id ";"
               "state"      {id} ";"
               "branches"   {num}* ";"
               "next"       {num} ";"
               { "commitid" sym ";" }

desc      ::=  "desc"  string

deltatext ::=  num
               "log"   string
               "text"  string

num       ::=  { digit | "." }+

digit     ::=  "0" through "9"

id        ::=  { idchar | "." }+

sym       ::=  {idchar}+

idchar    ::=  any visible graphic character except special

special   ::=  "$" | "," | "." | ":" | ";" | "@"

string    ::=  "@" { any character, with @ doubled }* "@"

word      ::=  id | num | string | ":"

intchar   ::=  any character, except @

thirdp    ::=  "^L" {intchar}*

intstring ::= "@" {intchar}* {thirdp}* "@"

๐Ÿ“ Additional Particulars

โฑ๏ธ Stamp Resolution

Timestamps appear in two places: delta date (second resolution) and filesystem modification time (subsecond if supported). Historically up to 5.9.4, RCS was agnostic to subsecond component, except for '-T' option which ignored subsecond on read and set 0 on write. After 5.9.4, if filesystem supports it, RCS reads/writes subsecond resolution with '-T' option. Delta date is limited to second resolution by design.

โณ Still Missing

Unordered list of to-do musings:

๐Ÿ› Reporting Bugs

Visit RCS homepage to file bug report online, or email help-rcs@gnu.org. Include: RCS version, commands, hardware/OS, input files, expected behavior, problem description, configure options, anything else helpful. Patches welcome via git format-patch with ChangeLog entries.

๐Ÿ“„ GNU Free Documentation License

Version 1.3, 3 November 2008. Copyright (C) 2000,2001,2002,2007,2008 Free Software Foundation, Inc. https://fsf.org/. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

(Full license text omitted for brevity; see original document for complete terms.)

๐Ÿ“‘ Index

rcs
๐Ÿ“˜ NAME ๐Ÿš€ Quick Reference ๐Ÿ“– Overview
๐Ÿ† Credits ๐Ÿง  Concepts ๐Ÿš€ Quick Tour
๐Ÿ”ง Usage
๐Ÿงฉ Common Elements ๐Ÿ’พ ci (Checkin) ๐Ÿ“ฅ co (Checkout) ๐Ÿ” ident ๐Ÿ”€ merge ๐Ÿ”ง rcs (Administration) ๐Ÿงน rcsclean ๐Ÿ“Š rcsdiff ๐Ÿ”€ rcsmerge ๐Ÿ“‹ rlog
๐Ÿ› ๏ธ Hacking
๐Ÿ“ File Format โฑ๏ธ Stamp Resolution โณ Still Missing ๐Ÿ› Reporting Bugs
๐Ÿ“„ GNU Free Documentation License ๐Ÿ“‘ Index

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-31 14:00 @216.73.217.152
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^