A Quick Introduction to RCS

A Quick Introduction to RCS


RCS stands for Revision Control System. Do a "man rcsintro" for the verbose description. Basically allows you to lock files so only one person edits them at a time. RCS is also a good way of checkpointing your own work. RCS effectively keeps a copy of every version you've ever checked in, so you can go back to older versions of your files. I use RCS even when I'm the only ones who will touch the files.

Basic Stuff

Suppose you have a file f.c that you wish to put under control of RCS. If you have not already done so, make an RCS directory with the command
              mkdir  RCS
If you are sharing files with other members of your group, make sure that the RCS directory is group writeable. Next, invoke the check-in command
              ci  f.c
This command creates an RCS file in the RCS directory, stores f.c into it as revision 1.1, and deletes f.c. It also asks you for a description. The description should be a synopsis of the contents of the file. All later check-in commands will ask you for a log entry, which should summarize the changes that you made.

Files in the RCS directory are called RCS files; the others are called working files. To get back the working file f.c in the previous example, use the check-out command

              co  f.c
This command extracts the latest revision from the RCS file and writes it into f.c. If you want to edit f.c, you must lock it as you check it out with the command
              co  -l  f.c
You can now edit f.c.

After you are done making revisions, you can check the file back in by invoking

              ci -u f.c
This checks the file in by incrementing the revision number properly and leaves a read-only copy of the file in the currently directory.

Support for checkpointing

A convenient way to checkpoint your project associate a name with the current working version of you project.
              rcs -nworks: RCS/*
This tells RCS to associate a symbolic name, i.e., works, with all the current version of all the RCS files in the current directory. Why is this convenient? Well, let's say the you and your partner have just gotten the non-preemptive minithreads package working. Being cautious, you use this naming facility to mark all the current versions of your source files with a label, let's say np_working. Now in the process of writing the preemptive version, your partner checks in broken code. You can conveniently get the working version back by typing:
              co -rworks RCS/*
You can view the symbolic names associated with an RCS file along with other information by typing:
              rlog f.c
This give you name associations and a list of all the revisions and the descriptions logged with each one for f.c.

Emacs support

Emacs has very complete support for RCS and other revision control systems. In fact, it's so complete that you can forget all the command-line RCS commands.

To use RCS with Emacs, you should have a RCS directory, just as before.

If you like, you can use the menu bar entries under "Tools:Version Control". Or, if you prefer keyboard commands, the only command you need to know is ctrl-x v v ("v" for "version").

All the other features of RCS are also easily available within Emacs.

You're now ready to share files safely!


cse451-TA@cs.washington.edu