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
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
done
794
Programming in Linux Part VI
With the file safely checked into the repository, you can check it out and modify it. To check a file
out for editing, use the co command. Here??™s an example:
$ co -l howdy.c
RCS/howdy.c,v --> howdy.c
revision 1.1 (locked)
done
The working file you just checked out is editable. If you do not want to edit it, omit the -l option.
Making Changes to Repository Files
To see version control in action, make a change to the working file. If you haven??™t already done so,
check out and lock the howdy.c file. Change anything you want, but I recommend adding \n to
the end of fprintf()??™s string argument because Linux (and UNIX), unlike DOS and Windows,
does not automatically add a newline to the end of console output.
Pages:
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437