This is an old revision of the document!
Using RCS
Simple usage for config files
Consider you want to have only a local revision control for some single files, e.g. confguration files below /etc
. A remote server or centralized storage might be an overhead, so lets do revision control locally in the same director with RCS. This is an example to handle /etc/hosts
with RCS. It assumes, that you don't care about locking other users out, as it is only used by root
anyway.
To initially create the revision control file inside /etc/RCS/
(i.e. locally) with the current file hosts
as initial version.
cd /etc mkdir RCS ci -l -d hosts
To checkin further updates, use
ci -l -d hosts
the -l
is needed, as RCS by default removes files on checkin. This will keep it checked out and locked (for further editing)
To do a rollback to version 1.3 , use
co -r1.3 -M hosts
To list all versions with changelog information, use
rlog hosts
To compare the current file with the last version checked in, do
rcsdiff hosts
To compare versions 1.2 and 1.4, use
rcsdiff -r1.2 -r1.4 hosts