You know that moment when you open a 500-line PR at 2am and it's just a wall of red and green? You can't tell if the code moved or if it actually changed. Yeah. We've all been there.
- Default
git difftreats moved code as delete here, add there — 200 lines of churn for a simple refactor. - No line numbers, so when the test fails at
runtime.py:223, you're counting hunks like a Victorian clerk.
Three lines in ~/.gitconfig give you side-by-side, syntax-highlighted diffs with moved-code detection.
[core]
pager = delta
[delta]
side-by-side = true
line-numbers = true
color-moved = zebraThat is the entire incantation. No plugin manager, no shell hooks. Pure git config.
| Feature | What it buys you |
|---|---|
core.pager = delta |
Every diff command (diff, show, log -p, even blame) gets syntax highlighting automatically. |
side-by-side = true |
Old left, new right. Your visual cortex does pattern-matching for free. Narrow terminal? Gracefully falls back to unified. |
line-numbers = true |
Real file line numbers in the gutter. When the test fails at line 223, you scroll and 223 is right there. |
color-moved = zebra |
Moved blocks get alternating pastel stripes 🦓 instead of red/green noise. A refactor diff separates "stuff that moved" (pastels) from "stuff that actually changed" (loud red/green). |
core.pager does not cover git add -p. If you want delta there too:
[interactive]
diffFilter = delta --color-only--color-only is mandatory — without it you break hunk selection.
- Force unified for one command:
git -c delta.side-by-side=false diff - Disable pager for piping:
git --no-pager diff - Inspect config:
delta --show-config - List themes:
delta --list-syntax-themes
git config --global core.pager delta
git config --global delta.side-by-side true
git config --global delta.line-numbers true
git config --global delta.color-moved zebra
# optional:
git config --global interactive.diffFilter "delta --color-only"
git config --global delta.syntax-theme "Monokai Extended"A regular diff has two stripes — red and green. Information density: two bits per line. Zebra has many alternating stripes — each pair of matched-move blocks gets its own pastel. Information density: one bit per line for "moved or not", plus one extra bit per matched pair for "which moved block this is". It is literally adding a dimension to the diff. The fact that the default name for it is "zebra" 🦓 is the most honest naming decision in modern dev tooling. They could have called it delta.move-tracking-pairs. They called it zebra. Bless them. 🙏💩🦄
Filed under: things that paid for themselves the first time you used them. 💸✨🦓