DIFF Command
[Previous] [Main] [Next]

DIFF Command


In order to see how two revisions of a file differ, you issue the cvs diff command. This is one of the most complex of the cvs commands. Here are some examples from the red-bean CVS book.

floss$ cvs diff
cvs diff: Diffing .
Index: hello.c
==============================================
RCS file: /usr/local/cvs/myproj/hello.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 hello.c
6a7
>   printf ("Goodbye, world!\n");
cvs diff: Diffing a-subdir
cvs diff: Diffing a-subdir/subsubdir
cvs diff: Diffing b-subdir

This looked at all files and just showed you the list that changed with lots of extra text. The "6a7" means line six add a new line 7 added after it. The -Q option (quiet) strips some of the text.

floss$ cvs -Q diff
Index: hello.c
===================================================================
RCS file: /usr/local/cvs/myproj/hello.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 hello.c
6a7
>   printf ("Goodbye, world!\n");