LinuxCommandLibrary

git-delta

Highlight changes in git diff and show

TLDR

List files from the current checked out branch that differ from the main branch

$ git delta [main]
copy

List files from a specific branch that differ from another specific branch
$ git delta [branch_1] [branch_2]
copy

SYNOPSIS

git-delta [OPTIONS] []

PARAMETERS

-h, --help
    Print help and exit.

-v, --version
    Print version.

--color-only
    Highlight without paging.

--paging-mode always|never|auto
    Control paging behavior (default: auto).

--true-color always|never|auto
    Force true color output.

--dark
    Use dark background theme.

--light
    Use light background theme.

--theme NAME
    Select color theme (e.g., GitHub).

--line-numbers
    Show line numbers.

--side-by-side
    Display diffs side-by-side.

-w, --width N
    Set output width.

--blame-colors
    Color lines by blame commit.

-c, --config-file FILE
    Use custom config file.

DESCRIPTION

git-delta (or simply delta) is a powerful viewer for git and diff output, transforming plain text diffs into rich, syntax-highlighted displays. It enhances readability with features like side-by-side views, line numbers, blame annotations, git commit hashes, file headers, and customizable themes.

Designed as a drop-in replacement for traditional pagers like less, it integrates seamlessly with git via configuration (core.pager = delta). When piped output from git diff, git log, or diff is passed to delta, it applies intelligent coloring: added lines in green, removed in red, unchanged in subtle tones, with syntax highlighting for 100+ languages.

Key strengths include hyperlinked file paths (clickable in terminals), word-diff mode (minusplus or plain), interactive navigation, and performance optimizations for large diffs. It supports dark/light modes, true color, and extensive customization via TOML config files. Widely adopted for its ergonomic improvements, delta makes reviewing code changes faster and more intuitive, especially in modern terminals.

CAVEATS

May conflict with other git pagers like less; configure explicitly. Performance dips on very large files without optimizations. Requires terminal supporting 256/true colors for full effect.

INSTALLATION

Via Cargo: cargo install git-delta. Or packages: apt install git-delta, brew install git-delta.

GIT INTEGRATION

git config --global core.pager delta; git config --global interactive.diffFilter delta for best results.

CONFIG

Edit ~/.gitconfig or ~/.config/git/delta/config.toml for themes, features.

HISTORY

Created by David Davison in 2019 as an open-source Rust project on GitHub. Gained popularity via Cargo/APT/Brew packages; v0.17+ added blame/line-numbers. Actively maintained with 20k+ stars.

SEE ALSO

git(1), diff(1), less(1), bat(1)

Copied to clipboard