1. Home
  2. Tutorials
  3. RCS
Yolinux.com Tutorial

RCS Intro - Revision Control System for Linux/UNIX

The RCS Revision Control System manages modifications to individual files. Files can be locked while checked out for change by a programmer to protect against poor coordination and comunications. Comparison with previous versions of the file and access to previous versions is also possible.

Example use of RCS:

First step:

Pick a working directory and add a link to the RCS repository.
      cd working_directory
      mkdir RCS
      ln -s /home/Project/src/RCS RCS
      
This links your working directory to the RCS repository.

Checkout:

      co -l file.c
In this case, the latest version of the file "file.c" will be placed in your current working directory and "locked" from use by other programmers.

To checkout a particular (previous) version:

      co -r1.2 file.c

Check out for reading not updating and locking:

 
co -u file.c


History/Status:

To view file info:
      rlog -b file.c


Quit / Clean-up:

Cleanup, don't commit changes:

      rcsclean -u *.c 


Check-in / Commit:

When done editing the file, check-in (commit) your changes:

     ci file.c

Diff:

      rcsdiff file.c 
This will compare the version of the file in your working directory with that of the original you checked out.

      rcsdiff -r1.2 file.c
Compare current working version with version 1.2.

The following will compare the two revisions of the file.

      rcsdiff -r1.1 -r1.2 file.c 


RCS Information - man pages on rcsintro, rcs, co, ci, ident, rcsclean, rcsdiff, rcsmerge, ident, rlog, merge.

Links: