If you’ve spent any time reviewing diffs in a terminal, you’ve felt the friction. The default git diff output works — coloured lines prefixed with + and -, hunks separated by @@ markers — but it’s genuinely hard to read for anything complex. Side-by-side comparisons, syntax highlighting, line numbers, and commit graph visualisation are all absent by default.
delta is a pager for git that fixes most of this. Written in Rust, it replaces the default diff output with something that looks closer to what you’d expect in a code editor — and once you’ve configured it, going back to raw git diff feels like a step backwards.
What delta actually does
delta sits between git’s diff output and your terminal as a pager (the same role less fills by default). When you run git diff, git log -p, git show, or git blame, delta intercepts the output and renders it with:
- Syntax highlighting using bat’s theme library — the same themes work in both tools
- Line-level diff highlighting that shows character-by-character what changed within a line, not just which lines changed
- Optional side-by-side mode that displays old and new versions next to each other
- Line numbers in both the old and new versions
- Merge conflict markers rendered in a readable format
- Git blame with improved formatting
The intra-line diff highlighting is particularly useful for reviewing single-line changes: instead of seeing the whole line marked as changed, you see exactly which characters were added or removed.
Installation
delta is available via most package managers:
# macOS
brew install git-delta
# Ubuntu/Debian
sudo apt install git-delta
# Arch Linux
sudo pacman -S git-delta
# Windows (via winget)
winget install dandavison.delta
# Cargo (any platform with Rust installed)
cargo install git-delta
After installation, you need to tell git to use it:
# ~/.gitconfig
[core]
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true # use n and N to move between diff sections
side-by-side = true
line-numbers = true
syntax-theme = Dracula
[merge]
conflictstyle = zdiff3
The diffFilter line makes delta work with git add -p (interactive staging), where it colours the hunks but doesn’t reformat them — necessary because interactive mode expects a specific format.
Side-by-side vs unified diffs
The side-by-side = true option in ~/.gitconfig enables the split view globally. You can toggle it per-command with --side-by-side or --no-side-by-side:
git diff --no-side-by-side HEAD~1 # override for a specific diff
Side-by-side is excellent for reviewing small-to-medium changes. For very wide files or large diffs, unified mode is sometimes easier — the side-by-side layout needs enough terminal width to show both columns legibly. Delta handles terminal width gracefully and falls back to unified if the terminal is too narrow, but you can also set a hard threshold:
[delta]
side-by-side = true
# only use side-by-side if terminal is at least 120 cols wide:
# (this is handled automatically by delta's width detection)
Themes
Delta uses bat’s syntax themes. To list available themes:
delta --list-syntax-themes
Popular choices:
| Theme | Good for |
|---|---|
Dracula | Dark terminals, high contrast |
Nord | Dark terminals, muted palette |
GitHub | Light terminals |
OneHalfDark | Dark terminals, balanced colours |
Solarized (dark) | Terminal-matched if you use Solarized |
gruvbox-dark | Warm dark scheme |
You can preview themes directly:
delta --show-syntax-themes # shows a sample diff in each theme
Merge conflict resolution
One genuinely underrated feature: when you have merge conflicts, delta’s --diff-so-fancy conflict style (enabled via merge.conflictstyle = zdiff3 in your gitconfig) renders them with syntax highlighting and clearer delineation of the base, ours, and theirs sections:
<<<<<<< HEAD (ours)
const timeout = 5000;
||||||| base
const timeout = 3000;
=======
const timeout = 8000;
>>>>>>> feature-branch (theirs)
The zdiff3 style (which requires Git 2.35+) adds the ||||||| base section showing what the conflicting area looked like before either branch changed it. This context makes it much easier to understand why two branches diverged, and delta renders all three sections with full syntax highlighting.
git blame with delta
git blame becomes considerably more readable with delta — it adds colour to the age of commits (recent lines stand out from old ones) and respects your theme:
git blame src/auth.ts
You can also integrate with git-blame-ignore-revs to hide bulk formatting commits from blame output, which delta renders correctly.
Working with lazygit
If you use lazygit, delta integrates cleanly. In your lazygit config (~/.config/lazygit/config.yml):
git:
paging:
colorArg: always
pager: delta --dark --paging=never
The --paging=never is important in lazygit’s context — the TUI handles scrolling itself, so delta shouldn’t spawn its own pager.
A complete working configuration
This covers the most useful options:
[core]
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true
side-by-side = true
line-numbers = true
syntax-theme = Dracula
file-style = bold yellow
hunk-header-style = file line-number
plus-style = syntax "#003800"
minus-style = syntax "#3f0001"
line-numbers-plus-style = "#00aa00"
line-numbers-minus-style = "#aa0000"
whitespace-error-style = 22 reverse
[merge]
conflictstyle = zdiff3
The plus-style and minus-style settings override the background colours for added/removed lines — the default colours work, but these give more contrast on dark themes. whitespace-error-style highlights trailing whitespace errors, which is useful for catching accidental whitespace in PRs.
What delta doesn’t do
A few things worth being clear about:
- It’s a pager, not a diff tool: delta doesn’t replace
git mergetoolfor actually resolving conflicts — it just makes the output readable - No mouse support: delta renders to the terminal via less; you navigate with keyboard only
- Large diffs can be slow: delta’s syntax parsing adds overhead for very large files. For huge diffs (50k+ lines),
--no-syntaxspeeds things up considerably - Not a replacement for a GUI: if you regularly review large PRs, a proper code review tool (GitHub, GitLab, etc.) still provides better navigation for big changesets
For everyday git work — committing, rebasing, reviewing your own changes before pushing — delta makes the terminal workflow genuinely better. It’s a small install with no configuration required to start, and the default output is already an improvement over plain git diff.