Text Diff
A text diff highlights the additions, deletions, and modifications required to transform one text file into another.
Layout
There are three layouts:
- Unified View shows a single combined view of changes.
- Two-Pane Layout shows Left and Right side by side.
- Two-Pane Layout with Connectors adds a center column with visual connectors between related changes.
You may switch between them using the View menu or the segmented control (top right).
Layout coloring uses green, red, and blue for additions, deletions, and modifications. Additionally, changed words within a line are highlighted to make intra-line differences easier to spot. These cues remain consistent across text, folder, and Mach-O comparisons.
Edit and Navigation
| Action | Shortcut |
|---|---|
| Previous / next row | ↑ / ↓ |
| Jump to first / last row | ⌘↑ / ⌘↓ |
| Previous change / next change | ⌥↑ / ⌥↓ |
| Switch to other pane | ⇥ |
| Copy to right | ⌘→ |
| Copy to left | ⌘← |
| Previous / next hunk | ⌥↑ / ⌥↓ |
| Extend selection | ⇧↑ / ⇧↓ |
| Copy entire hunk to right | ⇧⌘→ |
| Copy entire hunk to left | ⇧⌘← |
A selected line is indicated with a yellow rectangle. A hunk is a contiguous colored block indicating the same operation (add, delete, or modify) across multiple lines.
To copy a hunk means copying the entire block that contains the selected line, even if not all lines are explicitly selected. Copy actions are not available when the selected content already matches the destination or when the selection is not on a real line (for example, an alignment placeholder row).
Edits can be saved by persisting modified files (⌘S) or by saving a
patch (File ▸ Save as Patch). A patch file contains operations that
transform the left side into the right side. Patch files can later be
applied using
patch /path/to/original-file /path/to/exported.patch.
Compare Against Git Revisions
To compare a file against a previous revision choose Load previous.
When files are under version control, they display a tag that reveals their Git history.
When available, the filename area shows a revision label such as:
- Working Tree (uncommitted changes)
- HEAD (current commit)
- A short commit hash (historical revision)
Use the revision control to load a different version of the file into a pane. This is useful for reviewing changes over time without leaving the comparison view. Accessing Git revisions requires explicit permission. See Settings and Disk access for App Store apps for details.
View Options
Text diff exposes options that change how the comparison is computed or displayed. These options are available in the Settings button (top right).
- Ignore Patterns help suppress noise (such as IDs or timestamps) during comparison. See Ignore Patterns.
- JSON Normalization converts the input to a canonical form to make the comparison semantically meaningful. Saving a normalized file will rewrite the input file using the normalized format.
- Semantic line split default is configured in Settings, not in this options menu.