How do I use RCS for version control?


What is RCS?

From the rcsintro man page:

The Revision Control System (RCS) manages multiple revisions of files. RCS automates the storing, retrieval, logging, identification, and merging of revisions. RCS is useful for text that is revised frequently, for example programs, documentation, graphics, papers, and form letters.

The basic user interface is extremely simple. The novice only needs to learn two commands: ci(1) and co(1). ci, short for "check in", deposits the contents of a file into an archival file called an RCS file. An RCS file contains all revisions of a particular file. co, short for "check out", retrieves revisions from an RCS file.

RCS is great when you need to have a grip over different versions that have been floating around. E.g. if you send a file to someone and continue working on it, and then a week later he sends you email suggesting changes to the version in front of him, you need to backup to that version to be able to interpret the pagenumber/linenumber information that he uses. Another extremely neat application is to automatically get changebars on the margins of tex documents - this uses `changebar'.

How do I start using it?

  1. Make a directory named RCS
  2. Say "ci -l filename" and he will check it in for the first time. The first time, he will ask you to describe the file. The -l flag asks him to check it out the moment you have finished checking it in.
  3. As you go, writing newer versions, say "ci -l filename" once in a while and he will ask you to now to describe the CHANGES that you are making.
  4. Using "co" you can check out old versions at will. Lookup the "co" manpage.
  5. One nice program is "rcsdiff" which lets you see the differences between any two versions. E.g. if you say "rcsdiff" without any arguments, then it shows the changes made since the last checkin.
  6. Another nice program is "rlog" which summarises the history of changes on the file.

How do I learn more?

  1. Read the "rcsintro" man page (e.g., say `man rcsintro')
  2. Read man pages on ci, co, rcsdiff, rlog and rcs.

Ajay Shah, 2001.