From LQWiki
Jump to: navigation, search

RCS stands for Revision Control System. It's not as sophisticated as some of the newer revision systems such as CVS or GNU Arch but for a single-developer project or maintaining a single-user Linux machine, it's more than adequate.

Base Commands

  • rcs
  • co
  • ci

Quick Start

Putting a new file under version control.

Create directory 'RCS'.

$ mkdir RCS

This is not required but keeps the working directory from being cluttered with the version control files.

Initialize the file:

$ rcs -i new-file
RCS new-file: RCS/new-file,v
enter description, terminated with single '.' or end of 
NOTE: This is NOT the log message!

Enter file description at '>>' prompt, press RETURN, period, RETURN

This places a file named 'new-file,v' in the RCS directory.

Edit the file

$ co -l new-file

This creates 'new-file' with read-write permissions. Edit as usual.

Place the newly edited file under version control.

$ ci -l new-file
RCS/new-file,v  <--  new-file
new revision: 1.2; previous revision: 1.1
enter log message, terminated with single '.' or end of 

Enter log message at '>>' prompt, press RETURN, period, RETURN

The file is now under revision control and a copy of the file with read-write permissions is left in the working directory for further editing.

Detailed Command Descriptions

Man Pages:

File Locking

By default, files must be locked in order to be returned to version control. This is the '-l' option for the co command. When checking a file back under version control, normally the working file is deleted. By using the '-l' command line switch with the ci command, the file is versioned and then automatically checked out and locked once again. It's a bit confusing at first, but as long as you use the '-l' switch with both commands, a working copy of the versioned file will always be present.

File locking can be disabled with the command:

$ rcs -u file-name

See the rcs man page.

Retrieving Previous Revisions

Revision control