A unified diff is a format from 1990 designed to be applied by a program, not read by a person. Plus and minus signs at the start of lines, no syntax highlighting, no line numbers, and word-level changes hidden inside whole lines marked as replaced. delta takes that same output and renders it for human eyes.

The short verdict. Install it, put five lines in your .gitconfig, and every git diff, git show and git log -p becomes readable. But be clear about what it is: delta does not compute a diff. It is a pager — diff and git still do the work, delta only formats the result. Which is exactly why its output must never go anywhere near patch.

What it changes

Plain diff / git’s default pagerdelta
Syntax highlightingNoneYes, by file type
Line numbersOnly the hunk headerBoth sides, on every line
Changed wordsWhole line markedThe changed span highlighted within the line
Side by sideNoYes, with wrapping
Moving between filesSearch in lessn / N jumps file to file
Merge conflictsRaw markersRendered as a comparison
Output is a valid patchYesNo
Present on every systemYesNo

Installing it — mind the name

The package is git-delta; the command is delta. Installing a package called delta does not get you this tool. This trips people up on every distribution.

sudo apt install git-delta        # Debian, Ubuntu
sudo dnf install git-delta        # Fedora, RHEL family
sudo pacman -S git-delta          # Arch
cargo install git-delta           # anywhere
delta --version                   # confirm you got the right thing

The configuration that does the work

Almost all of delta’s value comes from wiring it into git properly, not from running it by hand. This is the whole setup:

# ~/.gitconfig
[core]
    pager = delta

[interactive]
    diffFilter = delta --color-only

[delta]
    navigate = true          # n and N move between files
    line-numbers = true
    side-by-side = false     # try true once you have a wide terminal

[merge]
    conflictStyle = zdiff3

[diff]
    colorMoved = default     # moved code shown as moved, not deleted and added

Three of those lines earn their place beyond the obvious:

  • interactive.diffFilter is what makes git add -p readable. Staging hunks is where you most need to see exactly what changed, and it is the setting people most often leave out.
  • diff.colorMoved is a git feature, not a delta one, but delta renders it well. A refactor that moves a function now looks like a move instead of a hundred deleted lines and a hundred added ones.
  • merge.conflictStyle = zdiff3 adds the common ancestor to conflict markers, so you can see what the original said. This one is worth setting whether or not you use delta.

Then check what you ended up with, and pick a theme that suits your terminal:

delta --show-config
delta --list-syntax-themes
git config --global delta.syntax-theme 'Monokai Extended'
git config --global delta.dark true      # or light

Using it outside git

You wantCommand
Compare two filesdelta old.conf new.conf
Render an existing unified diffdelta < changes.patch
Render diff’s outputdiff -u a.txt b.txt | delta
Highlight a search resultrg -n pattern | delta
Side by side, just this oncegit diff | delta -s
Compare two directoriesdiff -ru dir1 dir2 | delta

The ripgrep line is an underused one: piping rg -n output through delta gives you syntax-highlighted results with file headers, which makes reading matches across a codebase noticeably easier.

Where diff is still the right answer

  • Producing a patch. diff -u old new > fix.patch creates something patch and git apply can consume. Delta’s output is decorated for a terminal and is not a patch — do not redirect it to a file and expect it to apply.
  • Scripts and CI. diff‘s exit status is the interface: 0 identical, 1 differences, 2 trouble. Countless checks are built on if ! diff -q generated expected. Delta is a display layer and has no business in that pipeline.
  • Anything parsing the output. Colour codes and box drawing break every parser. Delta is smart enough to disable itself when not writing to a terminal, but do not rely on it — use git --no-pager diff when you mean machine-readable.
  • Servers and containers. It will not be installed, and diff always is. Knowing how to read a unified diff unaided is not optional.
  • Binary files, and cmp. Neither tool is for that; cmp tells you the first differing byte.

One neighbour worth knowing: difftastic takes a different approach, parsing both files and comparing syntax trees, so reformatting shows as no change at all. It is excellent on a code review and slower on a large repository. Delta is the everyday choice; difftastic is the one to reach for when a diff is dominated by noise.

Quick reference

delta a.txt b.txt        # compare two files
delta -s                 # side by side
delta --color-only       # keep the diff structure, only add colour
delta --show-config      # what settings are actually in effect
n / N                    # next / previous file, when navigate = true
git --no-pager diff      # bypass delta entirely

Related

  • bat vs cat — the same syntax-highlighting idea applied to reading files
  • ripgrep vs grep — whose output delta can also render
  • fzf — for picking the file or commit you want to look at
  • vim and nano — where you end up after reading the diff