Name

diff

Synopsis

cvs [cvs-options] diff [format-options] [options] [files ...]

Display the differences between two revisions of a file or files. By default, diff checks the sandbox copy against the revision in the repository that the sandbox copy was last synchronized with. If the files argument is a directory, all files under that directory are compared and files in subdirectories are also compared recursively. See also rdiff.

Synonyms: di, dif.

Standard subcommand options: -D, -k, -l, -r, -R.

The format-options determine how cvs diff displays any differences it finds. They operate in the same way as the options to the GNU diff program. This includes full support for the line and group format options; see the entry for diff in Chapter 2.

Example

This is a simple example to show how CVS displays the difference between the current and repository revisions of the Makefile.

    $ cvs diff Makefile
    Index: Makefile
    =============================
    RCS file: /var/lib/cvs/wizzard/Makefile,v
    retrieving revision 1.6
    diff -r1.6 Makefile
    25a26
    >       rm -f lib/*.o

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.