Using RCS (Revision Control System)

RCS (Revision Control System) is a backup versioning system. It is quite a liteweight versioning system, and forms the central core of CVS (Concurrent Versioning System).

RCS is good for single user use, often with configuration files and with coding local to a developer, especially if an editor had been extended to allow for RCS automatically.

RCS just keeps a copy of all the revisions you make to a document. I am using RCS now, everytime I save a document in VIM. If I need to step back to an earlier revision of the document I can.

Step One - Create an RCS Directory

RCS uses a separate directory to store the different versions of a file. Normally this is local to the files being stored (same directory).

$ mkdir RCS

Step Two - Check in a File

After you have created your file you want to check it in to the RCS directory store.

$ ci -l file

Using the -l, will do an automatic co -l (a checkout and lock), this keeps the file in the current directory at the same time.

Doing this after every file change is a great way to ensure you have a backup you can revert to.

Step Three - Getting a list of file versions

Sometimes you will want to review what is in the RCS repositry. The rlog command is the command to do this.

$ rlog file

Step Four - Comparing Versions

Once you have a list of versions you often want to check the difference between them. The rcsdiff command is used to achieve this.

$ rcsdiff -r1.1 -r1.2 file

You may also wish to quickly check a file without acutally checking it out or opening in an editor. The -p switch of the co command does this.

$ co -p -r1.1 file

Step Five - Checkout Another Version

Once you have decided which version to step back to the co command is used to check it out. The -r specifies the revision and the -l locks the file.

$ co -l -r1.1 file

Further References

I mentioned earlier I use RCS automatically in VIM. If you wish to try out this approach please donwnload the rcs.vim file and install in your vim plugin directory.