Unified diff

From Just Solve the File Format Problem
Revision as of 22:56, 20 September 2025 by Anonymoususer852 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
File Format
Name Unified diff
Ontology
Extension(s) .patch, .diff
Released 1991

Unified diff example

Unified diff example

Unified diff (or diff unified format, unified context diff, unidiff) is a diff format commonly used for patch files.

Contents

Identification

Unlike other diff formats, Unified diff has lines that begin with "@@".

Specifications

Software

  • GNU Diffutils: diff (with -u option), patch
  • git: git with either git diff..., git format-patch..., or git log -p can be used to provide unified diff
    • Conversely git apply ... can be used to apply diff or patches that were created via git and that the user is inside a functional git filesystem, where top directory has a folder named .git

Sample files

Links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox