RCS

About

Revision Control System (RCS) is an early version control system released in 1982 by Walter F. Tichy at Purdue University. It is a set of UNIX commands that allow multiple users to develop and maintain program code or documents. With RCS, users can make their own revisions of a document, commit changes, and merge them. RCS was originally developed for programs but is also useful for text documents or configuration files that are frequently revised.

Using RCS

Version A File

Change to the directory of the file to version and create a RCS directory sibling to it, or add a symlink to a global RCS directory.

mkdir RCS

Invoke the ci -u (check-in and unlock) command on the file:

ci -u php.ini

This command creates the RCS file php.ini,v in the RCS directory to hold all revisions of the php.ini file. By default the file being versioned is deleted, the -u puts a read-only copy of the file back in it’s original location.

It will ask for a file description which should be a synopsis of the contents of the file. Enter the description as one or more lines. To end the message the last line must be just a .:

RCS/php.ini,v  <--  php.ini
enter description, terminated with single '.' or end of file:
NOTE: This is NOT the log message!
>> This is my description.
>> .
initial revision: 1.1
done

Edit a Versioned File

Use the co -l (checkout and lock) command to prepare the file for editing. While you have the file checked out and locked, no one else can edit it.

co -l php.ini
RCS/php.ini,v  -->  php.ini
revision 1.1 (locked)
done

Edit the file with your favorite editor and then save and close the file:

nano php.ini

Checkin the edited file:

ci -u php.ini

It will ask for a log message which should summarize the changes that were made. Enter the log message as one or more lines. To end the message the last line must be just a .:

RCS/php.ini,v  <--  php.ini
new revision: 1.2; previous revision: 1.1
enter log message, terminated with single '.' or end of file:
>> My first change.
>> .
done

Version History

rcsdiff php.ini 

Version Diff

Compare the current version with an older version:

rcsdiff -r1.1 php.ini 

Compare two specific versions:

rcsdiff -r1.3 -r1.4 php.ini