Revision Control System (RCS)


The Revision Control System (RCS) is a software implementation of revision control that automates the storing, retrieval, logging, identification, and merging of revisions. RCS is useful for text that is revised frequently, for example programs, documentation, procedural graphics, papers, and form letters. RCS is also capable of handling binary files, though with reduced efficiency. Revisions are stored with the aid of the diff utility.

Concurrent Versions System (CVS) was developed as a successor to RCS. CVS is capable of dealing with RCS files en masse, and this was the next natural step of evolution of this concept, as it “transcends but includes” elements of its predecessor. CVS was originally a set of scripts which used RCS programs to manage the files. It no longer does that, rather it operates directly on the files itself.


  1. RCS is an example of a "Source Code Management System".
  2. These systems generally provide (at least):
    • Some means of keeping two (or more) programmers from modifying the same file at the same time.
    • Some sort of version numbering schemes.
    • Log messages to track why changes are made and by whom.
    • Allow backing out of changes.
  3. Those are minimal features. Some packages provide much more.
  4. Typically more nifty features means more "overhead". Choose a system that fulfills your needs without too much overhead.


  1. If the purpose of using RCS is to share among multiple people in a project, be sure to have a proper umask setting, minimally use the command umask 007
  2. The two primary RCS usage commands are:
    • ci : short for "check-in". Used to start a new file in RCS or release a lock on a file you had locked to work on.
    • co : short for "check-out". Used to lock a file for you to work on.
  3. RCS keeps version information for files in a specially formatted file (one per source code file) in a subdirectory named RCS.
  4. You need to make that directory in each source code directory.
  5. If RCS directory does not exist, the RCS system still works but it keeps its special version information files in the same directory as your source files which quickly clutters up that directory.
  6. rcsintro manual page says initially check in files with:
    % ci foo.c
  7. One annoying thing about RCS is that, by default, ci will set up RCS file, in this case RCS/foo.c,v, and removes foo.c.
  8. This often scares first time RCS users... :-)
  9. Get an unlocked read-only version back by doing:
    % co foo.c
  10. Instead of doing that, you can just initially use:
    % ci -u foo.c
  11. This checks-in the file but then immediately checks-out an unlocked version.
  12. To have an editable copy of the file do:
    % co -l foo.c
  13. This locks the file. Other users will not be able to check out the file for editing.
  14. to compare current foo.c to latest version in RCS file do:
    % rcsdiff foo.c
  15. To lock a file without checking it out (useful if you accidentally edited a file you forgot to check-out a locked copy of) do:
    % rcs -l foo.c
  16. If another user has already locked the file, this will fail.
  17. You can control which version numbers most RCS commands will use with the -r option.
  18. By default, ci will increment the file's minor version number, e.g. if you check-out version 1.3 and modify it, the next ci will make it version 1.4.
  19. You can increment the file's major version number, in this case 2.0, with:
    % ci -r2.0 foo.c
  20. RCS can put special information into source files.
  21. RCS looks for special marker variables in files and replaces them with data.
  22. RCS pays attention to these markers:
    • $Author: login name of user who performed the initial ci.
    • $Date: date of ci.
    • $Header: "standard" RCS information including full pathname of file.
    • $Id: index.html,v 1.1 2007/04/11 18:52:47 cwmiller Exp $Header: but only base part of filename.
    • $Locker: userid of current locker of file.
    • $Log: log message given during ci.
    • $RCSfile: name of RCS file.
    • $Revision: revision number.
    • $Source: full pathname to source.
    • $State: state of file (-s option to rcs or ci)
  23. NOTE: The RCS commands ci and co use normal file permissions to let you know what state the file is in. If you check out and lock a file, it will be writeable by you. But if you don't have a lock on the file, it will be read-only.
  24. It is not a good idea to use chmod command to change permissions.
  25. For more information, run man rcsintro, then read the follow-up manual pages that rcsintro refers you to.