The standard git diff command renders text modifications using simple monochromatic or basic terminal ANSI colour codes. When reviewing large codebases or complex multi-line refactoring, identifying granular changes becomes tedious. The delta tool (often styled as git-delta) replaces default diff output with full syntax highlighting, side-by-side split comparisons, and word-level diff emphasis directly inside your Linux terminal.
What Is Delta and How Does It Improve Git Workflows?
Built in Rust, delta acts as a pager for git, diff, and grep outputs. Key features include:
- Language-Aware Syntax Highlighting: Supports hundreds of programming languages and markup formats using real-time syntax parsers.
- Word-Level Diffing: Highlights the specific characters or variables altered within a modified line rather than highlighting the entire line blindly.
- Side-by-Side Views: Optionally splits additions and deletions into dual terminal columns.
- Seamless Integration: Integrates cleanly with your existing
~/.gitconfigwithout breaking standard git plumbing commands.
Installing Delta Across Linux Distributions
You can install delta through distribution package repositories, pre-built binary packages, or Cargo.
Installing on Ubuntu and Debian
On modern Debian and Ubuntu releases, install git-delta using the package manager:
sudo apt update
sudo apt install git-delta
Installing on Arch Linux and Fedora
Arch Linux includes the utility in the official repositories:
sudo pacman -S git-delta
On Fedora and RHEL derivatives:
sudo dnf install git-delta
Installing via Cargo
If you have Rust tooling installed, build the latest version directly:
cargo install git-delta
Configuring Git to Use Delta as the Default Pager
Once installed, configure your global git settings to route diffs and blame outputs through delta:
git config --global core.pager "delta"
git config --global interactive.diffFilter "delta --color-only"
git config --global delta.navigate true
git config --global delta.light false
git config --global delta.line-numbers true
These commands automatically update your ~/.gitconfig file. Alternatively, edit ~/.gitconfig directly to specify advanced visual styling:
[core]
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true
light = false
line-numbers = true
side-by-side = false
syntax-theme = Dracula
[merge]
conflictstyle = diff3
[diff]
colorMoved = default
Enabling Side-by-Side Diff Views
If you have a wide terminal monitor or Ultrawide display, split views provide immediate visual clarity for complex code additions and removals.
To enable side-by-side diffs globally, run:
git config --global delta.side-by-side true
Alternatively, trigger a one-off side-by-side view without modifying persistent settings:
git diff --side-by-side
Navigating Diffs Efficiently with Built-In Keybindings
With delta.navigate = true enabled, navigating across multi-file commit diffs is streamlined:
- Press n to jump directly to the next changed file header.
- Press N to jump backwards to the previous changed file header.
- Press q to exit the pager smoothly.