LinuxCommandLibrary

delta

View side-by-side diffs with syntax highlighting

TLDR

Compare files or directories

$ delta [path/to/old_file_or_directory] [path/to/new_file_or_directory]
copy

Compare files or directories, showing the line numbers
$ delta [[-n|--line-numbers]] [path/to/old_file_or_directory] [path/to/new_file_or_directory]
copy

Compare files or directories, showing the differences side by side
$ delta [[-s|--side-by-side]] [path/to/old_file_or_directory] [path/to/new_file_or_directory]
copy

Compare files or directories, ignoring any Git configuration settings
$ delta --no-gitconfig [path/to/old_file_or_directory] [path/to/new_file_or_directory]
copy

Compare, rendering commit hashes, file names, and line numbers as hyperlinks, according to the hyperlink spec for terminal emulators
$ delta --hyperlinks [path/to/old_file_or_directory] [path/to/new_file_or_directory]
copy

Display the current settings
$ delta --show-config
copy

Display supported languages and associated file extensions
$ delta --list-languages
copy

SYNOPSIS

delta [options] [file...] or git diff | delta

PARAMETERS

-h, --help
    Print help and exit

-V, --version
    Print version information

--dark
    Assume dark terminal background

--light
    Assume light terminal background

--true-color
    Use true (24-bit) color if available

-s, --side-by-side
    Display diffs side-by-side

--line-numbers
    Show line numbers in diffs

--paging-mode
    Paging: auto, always, never

--syntax-theme
    Set syntax highlighting theme (e.g., Nord, GitHub)

--max-line-length
    Truncate lines longer than n chars

--navigate
    Enable less-like navigation

--features
    Enable features: line-numbers, blame, etc.

--minus-{style,emph}
    Style for minus (removed) lines

--plus-{style,emph}
    Style for plus (added) lines

--config-files
    Load config from specific files

DESCRIPTION

Delta is a fast, customizable syntax-highlighting pager designed primarily for git diff output, but also works with plain diff, grep, and source code files.

It dramatically improves readability of diffs in the terminal by providing:
• Rich syntax highlighting for over 100 languages via syntect.
• Git-aware features like inline blame, hunk headers, line decorations (added/removed/modified).
• Configurable line numbers, character alignment, and word-diff highlighting.
• Side-by-side or inline layouts with zero-cost mouse/keyboard navigation via less(1).
• Themes (e.g., GitHub, Nord) and 24-bit true color support.
• Highly performant, processing large diffs instantly.

Usage is simple: alias in ~/.gitconfig with [pager "diff"] delta = delta, or pipe directly like git diff | delta. It respects git config for fine-tuning (e.g., delta.syntax-theme = Nord). Delta is written in Rust, ensuring speed and safety, and is a popular replacement for raw git diffs or tools like bat. Ideal for developers reviewing code changes efficiently.

CAVEATS

Not installed by default; requires Rust/cargo or package manager. Needs terminal with 256/true-color support for best results. Git integration requires git >=2.28.

INSTALLATION

Via Cargo: cargo install delta.
Debian/Ubuntu: apt install git-delta.
macOS: brew install delta.

GIT INTEGRATION

Add to ~/.gitconfig:
[core]
pager = delta

[delta]
syntax-theme = Nord

EXAMPLE

git diff --color=always | delta --side-by-side
Or delta Cargo.toml src/main.rs for file comparison.

HISTORY

Created by dandavison in 2019 as git-delta. Renamed to delta in 2021. Rewritten in Rust for performance. Actively maintained on GitHub with 20k+ stars; v0.17+ adds blame, decorations.

SEE ALSO

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

Copied to clipboard