Search the Web
 Linux Bible


When you check in a modified file, CVS opens an editor session to enable you to enter a log mes- sage that describes the changes you made. The editor used is the editor defined in the $EDITOR environment variable or compiled-in default (usually the vi text editor) if $EDITOR is undefined. This example did not use the -d option because the $CVSROOT environment variable is set.

To check out a specific version, or revision, of a file, use the -r option following the checkout or co command, followed by a revision number. For example, to check out revision 1.1 of the main.c file, use the following command:
$ cvs checkout -r 1.1 main.c

U main.c
To see the differences between two revisions, use the diff command, using the -r m.n , where m.n indicates the revision number you want to check. If you specify -r only once, the indicated version will be compared against the working file (using the diff option). If you specify -r twice, the two versions will be compared against each other. The following example compares revision 1.2 of showit.c to the current working revision (the revision currently in the working directory):
$ cvs diff -r 1.2 main.c
Index: main.c


RCS file: /space/cvs/newhello/main.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -r1.2 -r1.3
< char msg_hi[] = { "Hi there, programmer!" };
< char msg_bye[] = { "Goodbye, programmer!" };
> char msg_hi[] = { "Hi there, programmer!\n" };
> char msg_bye[] = { "Goodbye, programmer!\n" };
< printf("%s\n", msg_hi);
> printf("%s", msg_hi);

The continuation/full version of this article read on site - Linux Bible

© 2009