RCS


Anyone who has ever deleted all their files, or changed "just one character" and had a program totally fail to compile, will really benefit from using RCS. It is a simple way to ensure that you can "roll the clock back."

Say you have a file hello.cc. To use RCS, you need to type:
ci hello.cc
at the troi prompt (ci is short for "check in"). You will be asked to type in a comment. To end your comment, hit return and then type:
.
Then, if you do
ls
you will see no hello.cc, just a hello.cc,v. To modify your file, type:
co hello.cc
at the prompt (co is short for "check out"). If you do ls
now, you will see both hello.cc and hello.cc,v. Modify hello.cc in emacs or another text editor. When you are done, type:
ci hello.cc
Enter your comment, end it with a return, ., return, and you are done.

To really benefit from using RCS, you need to ci your files quite frequently (i.e. every time you think you might want to save your changes for posterity).

Now, say you modify hello.cc at 11:55 Saturday night before it is due. Tuesday morning you discover that your latest version doesn't compile. To get back version 2.4 (the previous version, in this case), type:
co -u -r2.4 hello.cc

If you ever have trouble checking in a file (e.g. because it says you have multiple locks set), type: rlog hello.cc
(rlog will also show you all the comments you've made). At the top of the output there will be a list of locked versions, say 1.4 and 1.6. Type:
rcs -u1.4 hello.cc
rcs -u1.6 hello.cc

You can keep all your RCS files in a subdirectory of your working directory called RCS. You don't have to go into the RCS directory to check files in or out, just do it from your working directory. For instance, if you are working in Hello and have a directory Hello/RCS, you can check files out in your Hello directory. That way, even if you delete all the files in Hello, you still have the RCS files in your RCS directory.

There are lots of other neat things about RCS; to learn them, type:
man ci
man co
man rcs


last modified: 7 April 1997 by owl