Skip to content
Latchkey

delta: A Better git diff Viewer

delta is a pager that reformats git, diff, and grep output with syntax highlighting, word-level diffs, and an optional side-by-side layout.

delta makes diffs readable. It plugs in as git’s pager, and like bat you must turn off its interactive paging when you run it inside CI.

What it does

delta reads unified diff output (from git diff, git show, or a diff pipe) and re-renders it with language-aware syntax highlighting, intra-line word diffs, and line numbers. Configured as git’s pager, every git diff command gets the treatment; --side-by-side shows old and new in two columns.

Common usage

Terminal
git diff | delta                       # one-off, pipe a diff through delta
git -c core.pager=delta diff           # use delta for this command
delta --side-by-side old.txt new.txt   # two-column view of two files
# persistent config in ~/.gitconfig:
git config --global core.pager delta
git config --global interactive.diffFilter 'delta --color-only'

Options

Flag / settingWhat it does
core.pager = deltaMake git use delta as its pager
interactive.diffFilterUse delta for git add -p and similar
-s / --side-by-sideTwo-column diff layout
-n / --line-numbersShow line numbers
--paging never|auto|alwaysControl paging (use never in CI)
--syntax-theme <name>Pick the highlighting theme
--features <list>Enable named presets from gitconfig

In CI

If you keep core.pager=delta and run git diff in CI, the pager can wait on a TTY and hang the job; set --paging=never or DELTA_PAGER=cat. To keep highlighted diffs in logs (for a review bot) pass --color-only and force --paging=never. Otherwise leave delta out of CI: a plain git diff is fine for machines.

Common errors in CI

"delta: command not found" means git-delta is not installed (brew install git-delta, cargo install git-delta, or a release deb; the binary is delta). A job hanging after a git diff is the delta pager waiting for input; add --paging=never. Note there is an unrelated delta package on some systems, so verify with delta --version showing the diff tool.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →