delta is a Rust-powered drop-in pager for git diff that adds syntax highlighting, side-by-side view, line numbers, and n/N keybindings to jump between files. You install it from your package manager (the package is called git-delta, but the binary is just delta), drop a five-line block into ~/.gitconfig, and every git diff, git show, git log -p, and git blame immediately becomes readable. No aliases, no wrappers — Git itself starts piping through delta.
Plain git diff is from a different era. It gives you green for added lines, red for removed lines, and absolutely nothing else — no syntax colors, no line numbers, no side-by-side comparison, no way to jump between files in a 40-file pull request. If you've ever caught yourself opening a diff in your editor "to actually read it," you've already discovered the problem. Diffs are how engineers spend a surprising fraction of every working day, and the default Git output is built for 1986 terminals.
delta is the fix that stuck. It's a single binary that Git invokes as a pager, it leans on the same syntax-highlighting engine bat uses, and once it's wired up you'll forget the configuration even exists. This article walks through the minimum ~/.gitconfig block you need, the full recipe with side-by-side view and navigation, and the half-dozen places delta improves Git output beyond git diff itself.
Why delta: what plain git diff never gets right
git diff was designed when terminals showed 16 colors and a "diff viewer" meant less with a green/red ANSI palette. It does its one job — show you what changed — but it skips everything that would make a diff actually pleasant to read.
delta fixes five specific things git diff was never going to get right:
- Syntax highlighting.
git diffcolors+and-lines, full stop. delta runs the file content through thesyntectRust crate (the same one bat uses) and gives you keyword, string, and comment colors inside both the added and removed lines. Reading a 200-line refactor goes from squinting to skimming. - Side-by-side view. Modern code review tools default to side-by-side because it matches how the brain compares two versions of the same thing. delta gives you the same layout in your terminal with one config flag, including automatic line wrapping for long lines.
- Line numbers.
git diffshows hunk headers like@@ -42,7 +42,9 @@and expects you to count from there. delta puts old and new line numbers in two gutters next to every line, exactly like a code review tool. - Navigation in large diffs. Press
nto jump to the next file,Nto jump back. Withgit log -pit also stops at commit boundaries. This single feature is what makes large pull requests reviewable in the terminal. - Word-level diff highlighting. When a single line changes by one character,
git diffdeletes the whole line and re-adds it. delta runs a Levenshtein edit-distance pass and highlights only the characters that actually changed, so you see at a glance whether the diff is a real change or a whitespace tweak.
Install delta (and the git-delta gotcha)
Installation is one command, with one naming quirk that catches everyone the first time.
# winget (built into Windows 11)
winget install dandavison.delta
# or Chocolatey
choco install delta
# or Scoop
scoop install delta
On Windows, delta works in PowerShell, Windows Terminal, and WSL. The Using Delta on Windows page in the manual has notes on terminal color depth and less.exe quirks.
After installing, verify the version:
delta --version
# delta 0.19.2 (or newer)
The installation page in the official manual lists every package manager including FreeBSD, Nix, and conda.
The minimum ~/.gitconfig to get delta working
You only need five lines. This is the exact block from the official Get Started page, and it's what 90% of delta users actually run in production:
[core]
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true # use n and N to move between diff sections
dark = true # or `light = true`, or omit for auto-detection
[merge]
conflictStyle = zdiff3
That's it. After saving ~/.gitconfig, every Git command that produces diff output starts piping through delta automatically. The official manual lists what that covers:
git diffgit showgit log -pgit stash show -pgit reflog -pgit add -p
A breakdown of what each line does:
core.pager = deltais the line that makes Git pipe diff output through delta. Without it, nothing else activates.interactive.diffFilter = delta --color-onlyis what makesgit add -pshow colored hunks too. The--color-onlyflag is important —git add -pparses the diff to know what to stage, so delta must not rewrite the format, only color it.delta.navigate = trueactivates thenandNkeys insideless. This is the single most useful feature in large diffs and there's no reason to leave it off.delta.dark = truetells delta to pick colors for a dark terminal. If you use a light terminal uselight = trueinstead. Auto-detection (omitting both) works in most terminals, but if you ever run delta insidelazygit,zellij, ortmux, pin it explicitly — the color choosing manual calls this out.merge.conflictStyle = zdiff3isn't strictly a delta setting, but delta knows how to displayzdiff3merge conflicts as two readable diffs from the merge base. If you've ever stared at a<<<<<<< HEADblock trying to remember which side is yours, this is the setting that makes merges legible.
Run git diff now in any repo with uncommitted changes. You'll see syntax-highlighted file headers, line numbers in two gutters, and a clean colored output. Press n to jump to the next file. That's the entire baseline experience.
The full recipe: side-by-side, line numbers, and named features
The five-line minimum is what 90% of users run, but if you're going to spend a few hours a day reading diffs, the next ten minutes of config will pay off forever. Here's the complete recipe I use:
[core]
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
features = side-by-side line-numbers decorations
navigate = true
dark = true
syntax-theme = OneHalfDark
side-by-side = true
line-numbers = true
hyperlinks = true
hyperlinks-file-link-format = "vscode://file/{path}:{line}"
[delta "decorations"]
commit-decoration-style = bold yellow box ul
file-style = bold yellow ul
file-decoration-style = none
hunk-header-decoration-style = yellow box
[delta "line-numbers"]
line-numbers-left-format = "{nm:>4}┊"
line-numbers-right-format = "{np:>4}│"
line-numbers-left-style = blue
line-numbers-right-style = blue
[merge]
conflictStyle = zdiff3
A few things to notice:
features = ...is a list of named groups. Each group is its own[delta "name"]section. This is delta's way of keeping a long config readable — instead of dumping every option into[delta], you tag them with a name and switch them on withfeatures. The features reference in the manual explains the inheritance rules.syntax-theme = OneHalfDarkpicks a bat-compatible theme. delta ships with the same themes bat does (because it depends onbatas a Rust crate). Rundelta --show-syntax-themesto see them all in your own terminal — each theme renders against a sample of code, so you can pick by eye instead of guessing.side-by-side = trueactivates the two-pane view. Long lines wrap automatically, with arrow markers showing where the wrap happened. The side-by-side manual covers--wrap-max-lines,--wrap-left-symbol, and the other wrap-control flags if the defaults bother you.hyperlinks = trueturns commit hashes and file paths into clickable terminal hyperlinks. Thehyperlinks-file-link-formatline above opens files in VS Code when you click them. Replace withidea://...,cursor://..., orsubl://...for your editor of choice — the hyperlinks manual lists the supported formats.line-numbers-left/right-formatcontrols the gutter glyphs. The{nm}placeholder is the "minus" (old) line number,{np}is the "plus" (new) one. The Unicode box-drawing characters (┊and│) are pure cosmetics, but they make the gutter feel like a code review tool instead of a terminal dump.
Toggling side-by-side from the command line
Side-by-side is great for code review, less great for a one-line typo fix. delta supports a DELTA_FEATURES environment variable that lets you flip features on and off without editing your config:
# Temporarily enable side-by-side, on top of whatever is in gitconfig
export DELTA_FEATURES=+side-by-side
# Reset to whatever gitconfig says
export DELTA_FEATURES=+
The + prefix means add to the existing features, not replace them. This is documented in the features-named-groups-of-settings page — useful pattern to remember when you want side-by-side just for one git log -p session.
Themes, styles, and matching your terminal
delta picks a theme automatically, but the second thing every user wants to do is change it. There are two layers to know about: syntax themes (the colors of code inside hunks) and delta styles (the colors of +, -, gutters, and decorations).
Syntax themes (code colors)
# Show every available theme rendered against a code sample
delta --show-syntax-themes
# Filter by background — useful before picking
delta --show-syntax-themes | less -R
delta's syntax themes are inherited from bat — they're literally the same .tmTheme files. Popular picks for dark terminals: OneHalfDark, Monokai Extended, Dracula, gruvbox-dark. For light terminals: GitHub, OneHalfLight, Solarized (light). To bring your own theme, drop a .tmTheme file into $(bat --config-dir)/themes/ and run bat cache --build.
Delta styles (the parts delta draws itself)
The +/-/gutter colors are controlled by --minus-style, --plus-style, --zero-style, and a few dozen more. Style strings use the same syntax as Git's color config:
[delta]
minus-style = syntax "#3f1f1f"
plus-style = syntax "#1f3f1f"
minus-emph-style = syntax bold "#7f1f1f"
plus-emph-style = syntax bold "#1f7f1f"
The keyword syntax means "use the syntax-highlighter color for the foreground." That's the trick that lets delta keep the code readable even when the line has a colored background — the foreground stays whatever color the syntax theme would have used, while the background marks added/removed.
The full list of stylable elements is in delta --help under the STYLES section. The choosing-colors page in the manual has the same reference with examples.
Beyond git diff: blame, grep, merge conflicts, stash
delta is wired up as Git's pager, so it transparently handles every command that produces diff or blame output. Here are the four places it goes from "nice" to "actually changes how you work."
git blame with hyperlinks
git blame src/handlers.rs
With delta as the blame pager (and hyperlinks = true in the config above), each commit hash in the blame output becomes a clickable link to the commit page on GitHub, GitLab, SourceHut, or Codeberg. Click a hash to open the PR in your browser. The git-blame manual page explains how the host detection works — delta reads the remote URL and picks the right format automatically.
To make blame use delta as its pager (it's not always the default), pin it explicitly:
[pager]
blame = delta
Merge conflicts (zdiff3 + delta)
This is the killer feature for anyone who has hit a hairy merge in a long-lived branch. Set merge.conflictStyle = zdiff3 and delta will render the conflict as two diffs — one from the merge base to "ours," one from the merge base to "theirs":
git merge feature-branch
# conflict happens
git diff
Instead of three blocks of code separated by <<<<<<< and =======, you get the actual changes each side made. The merge-conflicts manual shows what this looks like — once you've seen it once, plain conflict markers feel like reading hex dumps.
rg and git grep with syntax highlighting
delta also handles grep output. Pipe ripgrep through it and you get the same syntax-highlighted file gutters around each match:
# rg --json is the recommended format — it's unambiguous
rg --json -C 2 'fn handle_' src/ | delta
The --json flag matters: regular rg and grep output have parsing ambiguities that delta sometimes guesses wrong on. JSON output makes it deterministic. The grep manual page recommends this exact pattern. For an end-to-end ripgrep guide, see the ripgrep deep dive elsewhere in this series.
git stash show -p and git reflog -p
These are the small wins. Anything that produces diff output benefits from delta automatically — git stash show -p becomes a real review experience, and git reflog -p lets you scroll back through your own history without squinting. There's nothing to configure; the core.pager = delta line covers them all.
FAQ
Does delta replace git diff, or is it a wrapper?
Neither, exactly. delta is a pager — Git still runs git diff and produces the same diff text it always has, then pipes that text through delta for display. Nothing about how Git computes diffs changes. Scripts that call git diff > file.diff keep working unchanged because Git only invokes a pager when stdout is a TTY. This is the same convention git log uses.
Why does delta show no colors when I redirect to a file?
Same convention as bat, ls, and grep — delta auto-detects whether stdout is a real terminal. Pipe it into tee, redirect into a file, or capture into a variable, and delta drops to plain output. To force colors anyway, pass --color-only or set the appropriate Git pager flags. If you want a permanent colored capture for a screenshot or PDF, the export to HTML/PDF tip in the manual walks through aha and ansifilter.
How do I temporarily turn side-by-side off?
git -c delta.side-by-side=false log -p
The -c flag overrides any config option for one command. This is the cleanest way to do one-off changes without editing your config. The configuration manual shows the same trick for delta.line-numbers=false.
delta vs diff-so-fancy vs diff-highlight — which one?
delta is the modern winner. diff-highlight is a Perl script bundled with Git that does word-level highlighting and nothing else. diff-so-fancy is a polished bash wrapper around diff-highlight from 2016. delta is newer (Rust, 2018+), faster, and has every feature both of them have plus side-by-side, navigation, syntax highlighting, and merge-conflict rendering. delta even ships emulation modes for both — --diff-highlight and --diff-so-fancy flags — if you prefer the older look.
Can I use delta outside Git, like with Mercurial or Jujutsu?
Yes. delta accepts standard unified-diff format as input, so anything that produces a unified diff can pipe through it. For Jujutsu the recommended setup is in ~/.config/jj/config.toml:
[ui]
pager = "delta"
diff-formatter = ":git"
This is documented in the delta configuration manual under the Jujutsu section. For Mercurial, set pager = delta in hgrc and you're done.
Will delta slow down git log -p on a huge repo?
Practically, no. delta processes diff output line by line and streams it to less, so the latency you notice is the same as git log -p itself — Git is the slow part. On a 10,000-commit history with -p, delta adds a few hundred milliseconds total, dominated by syntax highlighting on the first few visible files (less only buffers what you scroll through). If you want to skip syntax highlighting for raw speed, set syntax-theme = none — that disables the most expensive step.
Why does delta crash after I update bat?
The most common cause: you ran bat cache --build with a different bat version than the one delta links against. delta embeds bat as a Rust crate, so if your local bat cache has a different format, delta panics with a memory error. The fix is to install the same bat version listed in delta's Cargo.toml and rebuild the cache. delta 0.19+ requires bat 0.26 or newer.
Wrapping Up
Five lines of ~/.gitconfig is all delta really needs to start improving your day. Add it to a fresh dev environment, run git diff once, and you immediately see why this is the modern Rust CLI tool that ships in every dotfiles repo. The full recipe — side-by-side, navigation, hyperlinks, custom decorations — is a ten-minute upgrade that rewards itself every time you open a pull request from the terminal.
The bigger pattern delta belongs to is the modern shell stack: bat for files, ripgrep for searching, delta for diffs, all sharing themes and conventions. Configure them once, copy the configs into your dotfiles repo, and the experience follows you to every new machine. For the engineering reason these Rust tools outrun the GNU originals, read Why Rust CLI Tools Are So Fast. For the broader map of which classic tool each Rust replacement covers, see the CLI tools map.