Skip to content

Guide · Open source

How to use delta: syntax-highlighted git diffs in your terminal

Updated · written with AI from the project's own documentation and checked against our catalogue data

Delta is a terminal program that sits between git and your screen and recolors diffs, git blame output and grep results with syntax highlighting. It is aimed at developers who read git diffs or git show output in the terminal often. After this guide you will be able to install it, set it as git's pager, and turn on navigation, side-by-side view and line numbers.

deltadandavison/delta · ★ 32.6k · MIT

Quick start

  1. 1Install git-delta. Install the package called git-delta with your package manager. The program you run is named delta.
  2. 2Set delta as the pager. Run git config --global core.pager delta so git output goes through delta.
  3. 3Enable interactive filtering. Run git config --global interactive.diffFilter 'delta --color-only' to color interactive diffs.
  4. 4Turn on navigation. Run git config --global delta.navigate true, then use n and N to move between diff sections.
  5. 5Pick light or dark mode. Set delta.dark or delta.light to true, or omit both to let delta detect your terminal background.
  6. 6Set merge conflict style. Run git config --global merge.conflictStyle zdiff3 for clearer conflict display.

Install delta and check the executable name

Delta is installed through a package manager. The package is called "git-delta" in most package managers, but the executable you run is just delta. Git itself is the only prerequisite listed.

Once installed, you can confirm the program is available by running delta -h for the short help or delta --help for the full manual.

delta -h

Set delta as git's pager

Git uses a pager to show long output such as diffs and logs. Setting core.pager to delta makes git send its output through delta. The command below sets this for all your repositories.

You can also put the same setting in your ~/.gitconfig file under a [core] section, with pager = delta.

git config --global core.pager delta

Use delta for interactive diff filtering

When you use git add -p or other interactive commands, git can pass the diff through a filter. Setting interactive.diffFilter to delta --color-only applies delta's colors in that interactive view.

git config --global interactive.diffFilter 'delta --color-only'

Turn on navigation and choose light or dark mode

With navigation enabled, you can press n and N to move between files in large diffs, and between diffs in log -p views. The README also notes that you can set delta.dark or delta.light to true, or leave both out so delta detects your terminal background automatically.

The same settings can go into ~/.gitconfig under a [delta] section, using navigate = true and dark = true.

  • n moves to the next file or diff section
  • N moves to the previous one
git config --global delta.navigate true git config --global delta.dark true # or `delta.light true`, or omit for auto-detection

Improve merge conflict display

Delta shows merge conflicts in a clearer way. The README recommends setting git's merge conflict style to zdiff3, which delta works well with.

git config --global merge.conflictStyle zdiff3

Try side-by-side view and line numbers

Side-by-side view shows the old and new versions in two panels, with syntax highlighting in both and long lines wrapped automatically. Line numbering is a separate option. Both are set under the [delta] section of your gitconfig.

Side-by-side view is in the user manual at dandavison.github.io/delta/side-by-side-view.html, and line numbers are covered at dandavison.github.io/delta/line-numbers.html.

  • Side-by-side view: side-by-side = true
  • Line numbers: line-numbers = true
[delta] side-by-side = true line-numbers = true

Use delta with grep and blame

Delta also highlights output from rg, git grep and grep, and improves git blame display with syntax highlighting. The --hyperlinks option turns commit hashes into links to your hosting provider. The README lists GitHub, GitLab, SourceHut and Codeberg as supported providers.

The syntax-highlighting themes are the same ones bat uses, and you can preview them with delta --show-syntax-themes.

delta --show-syntax-themes --dark

What people use it for

  • Reviewing git show output for a commit in the terminal with colored, word-level changes
  • Reading git blame output with syntax highlighting
  • Viewing rg or git grep matches with colored output
  • Applying bat's color themes to your git diffs
  • Comparing changes side by side with line numbers

Frequently asked questions

How do I install delta?

Install it with your package manager. The package is called git-delta in most package managers, but the executable is named delta. The README links to the full installation page on the project homepage for details.

Is delta free to use?

Delta is open source under the MIT licence, which is stated in the project's listing. The licence allows you to use it freely.

What do I need to run delta?

The listed prerequisite is git. Delta is a terminal program, so it works in a command-line environment rather than a graphical git client.

How do I make git use delta for all diffs?

Run git config --global core.pager delta. This sets delta as git's pager for every repository on your machine.

Can delta change how my diffs look too much?

Yes, delta changes diff output by design. If you want plain git output, do not set delta as your pager, or remove the core.pager setting.

What are the alternatives to delta?

The comparable projects listed are diff-so-fancy, diff-highlight and bat. Delta also includes diff-highlight and diff-so-fancy emulation modes, so you can match their output style if you prefer.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Delta suits developers who read git diffs, blame or grep output in the terminal and want syntax highlighting and word-level changes. If you only use a graphical git client or web-based code review, or want git's plain output unchanged, it is not the right tool, and diff-so-fancy or diff-highlight may suit you better.

Install options & downloads