Introduction
A diff, or patch, is a text file listing the differences between two versions of files.
It is written by GNU diff and
version control systems, and applied with the patch program to make the
same changes elsewhere.
Structure
There are several forms, chiefly the normal, context and unified formats. A unified
diff begins with a two-line header naming the two files, then hunks. Each hunk opens
with a line giving the line ranges between @@ marks, followed by lines that
start with a space (unchanged), - (removed) or + (added).
Not described
Known, not yet covered
- Reference: this page is a summary; the normal, context and extended forms are not yet described on this site.
- Viewer: the site has no viewer for diff files.
Links
Software
- GNU Diffutils – the diff, diff3, sdiff and cmp programs
Reference
- Unified Format – the GNU Diffutils manual