20.14 RCS Basics
You don't need to ask the system manager to restore files. You can recover any version you want with one command. Here is a simple introduction to RCS.
There are only two more commands that you will need to know. If you checked out a file for editing, and later on decided you didn't want to change it, use: % and if you want a list of all files currently checked out, use: % (If you don't use RCS often, you may want to store those command lines in aliases or shell functions (10.1 ) with names like Checkout , Checkedout , and so on.) That's all there is to it! If you are not using RCS or SCCS, you should. They are the best way to protect yourself and do not require dozens of tapes. It is much easier to just type: % One command, and version 1.12 is restored. If it's not the right one, restore the version before or after the one you just grabbed. (If you don't want to create a file, you can add the -p option to send the file to standard output. Pipe the co output to another program: a pager, a printer, etc.) If you are worried that you are keeping 12 versions of the file on the disk, and that this will use up a lot of disk space, don't. RCS stores the differences between versions, not 12 separate copies of the file. It can recover any version of the file. Suppose you delete a file by accident? Well, if the file is just checked out with a co , it will be retrieved and marked read-only, so deleting the file will cause rm to ask you for confirmation. If you do delete it, you can recover it with another co command. Suppose you check out a file with co -l , because you planned to change it. Well, if this file gets deleted accidentally, you would lose the most recent changes. This is why you should check your files back into RCS frequently - several times a day or even more. Do it whenever you make significant changes to the file, and it would be difficult to remember all of the changes. Making hundreds of changes to a file without checking it back into the system is just begging for trouble. This brief overview left out a lot of features and helpful information. For example, RCS can:
To find out more, see the RCS manual pages. rcsintro (1) gives a more complete overview; manpages like ci (1) have details on the many other useful features. Finally, O'Reilly & Associates' Applying RCS and SCCS is packed with tips and techniques for using revision control in group projects (where you'll need it even more). Articles 27.10 and 20.15 explain tools for searching RCS files. The script in article 25.5 , rcsmore (and rcsless and rcspg ), makes it easy to read through RCS files. - , |
|