Checking Files In and Out


You can accomplish a lot with RCS using only two commands (ci and co) and a directory named RCS. ci stands for "check in," which means storing a working file in the RCS directory; co means "check out" and refers to retrieving an RCS file from the RCS repository. To get started, you need to create an RCS directory. All RCS commands will use this directory, if it is present in your current working directory. The RCS directory is also called the repository. When you check a file in, RCS asks for a description of the file, copies it to the RCS directory, and deletes the original. "Deletes the original"? Ack! Don't worry, you can retrieve it with the check out com- mand,co.


Here's how to create an RCS directory:
$ mkdir RCS
Next, create the following source file (naming it howdy.c) in the same directory in which you created the RCS directory. /*
* $Id$
* howdy.c - Sample to demonstrate RCS Usage
*/
#include <stdio.h>
int main(void)
{
fprintf(stdout, Howdy, Linux programmer!");
return EXIT_SUCCESS;
}
Now, use the command
ci howdy.c
to check the file into the repository:
$ ci howdy.c
RCS/howdy.c,v <-- howdy.c
enter description, terminated with single '.' or end of file:
NOTE: This is NOT the log message!
>> Simple program to illustrate RCS usage
>> .
initial revision: 1.1


The continuation/full version of this article read on site - www.podgrid.org - Linux Bible