Terminal GuideTerminal Guide
git-delta icon

delta (Git)

Git Tools
macOSLinuxWindows
Rust

Syntax-highlighting pager for git diff/log/show.

Official Website

Features

Syntax HighlightingSide-by-Side ViewWord-Level DiffLine Numbers

Installation

Homebrew
brew install git-delta
Pacman (Arch)
pacman -S git-delta
Cargo (Rust)
cargo install git-delta

Why Use delta?

delta is a feature-rich diff viewer written in Rust. By setting it as Git pager, you can display git diff and git show output beautifully with syntax highlighting.

Syntax Highlighting

Uses the same syntax definitions as bat/Sublime Text. Beautiful highlighting with support for many languages.

Side-by-Side Display

Display before and after changes side by side. Makes large changes easier to compare and speeds up reviews.

Word-Level Diff

Highlight changes within lines. See exactly what changed at a glance.

Rich Customization

Fine-grained settings for themes, colors, display formats. Customize display to your preferences.

Output Example

src/main.rs
────────────────────────────────────────────────────────────────
1
use std::io;
2
3
- fn old_function() {
3
+ fn new_function() {
4
println!("Hello, world!");
5
}
────────────────────────────────────────────────────────────────

delta output example: Syntax highlighting and changes within lines are highlighted.

Side-by-Side Display

── Before ──
src/main.rs:3
fn old_function() {
println!("Hello!");
}
── After ──
src/main.rs:3
fn new_function() {
println!("Hello!");
}

Use the --side-by-side option for side-by-side display.

Installation

Installation
# macOS (Homebrew)
brew install git-delta

# Ubuntu/Debian
sudo apt install git-delta
# or
wget https://github.com/dandavison/delta/releases/download/0.16.5/git-delta_0.16.5_amd64.deb
sudo dpkg -i git-delta_0.16.5_amd64.deb

# Arch Linux
sudo pacman -S git-delta

# Fedora
sudo dnf install git-delta

# Cargo (Rust)
cargo install git-delta

# Windows (Chocolatey)
choco install delta

# Windows (Scoop)
scoop install delta

Git Integration Setup

By setting delta as Git pager, the output of git diff,git show, git log -p, etc. will automatically be displayed with delta.

~/.gitconfig
# Add to ~/.gitconfig

[core]
    pager = delta

[interactive]
    diffFilter = delta --color-only

[delta]
    navigate = true    # Move between files with n/N
    light = false      # Dark theme (true: light theme)
    side-by-side = false

[merge]
    conflictstyle = diff3

[diff]
    colorMoved = default

Basic Usage

Standalone Usage

Basic Commands
# Display diff output with delta
diff -u file1.txt file2.txt | delta

# Pipe git diff output
git diff | delta

# Compare two files
delta file1.txt file2.txt

# Side-by-side display
delta --side-by-side file1.txt file2.txt

# Use specific theme
delta --syntax-theme="Dracula" file1.txt file2.txt

With Git Commands

Git Commands
# git diff (automatically uses delta)
git diff
git diff --staged
git diff HEAD~3

# git show
git show HEAD
git show abc1234

# git log with diff
git log -p
git log -p --follow -- path/to/file

# Display merge conflicts
git diff --merge

Common Options

OptionDescription
--side-by-side / -sSide-by-side display
--line-numbers / -nShow line numbers
--navigateEnable navigation between files with n/N
--syntax-themeSpecify syntax highlighting theme
--lightUse light theme
--darkUse dark theme
--diff-so-fancydiff-so-fancy style display
--show-themesShow available themes list

Configuration and Customization

Detailed Configuration Example

Detailed Configuration
# ~/.gitconfig [delta] section

[delta]
    # Basic settings
    navigate = true
    light = false

    # Line numbers
    line-numbers = true
    line-numbers-minus-style = "#ff6b6b"
    line-numbers-plus-style = "#6bcb77"
    line-numbers-left-style = blue
    line-numbers-right-style = blue

    # Highlighting
    syntax-theme = "Monokai Extended"
    minus-style = syntax "#3a0f0f"
    plus-style = syntax "#0f3a0f"
    minus-emph-style = syntax "#800000"
    plus-emph-style = syntax "#008000"

    # File header
    file-style = bold yellow ul
    file-decoration-style = yellow box
    hunk-header-style = file line-number syntax
    hunk-header-decoration-style = blue box

    # Blame
    blame-palette = "#1e1e2e" "#2a2a40" "#3a3a50"
    blame-format = "{author:<18} {commit:<8} {timestamp:<15}"

    # Side-by-side settings
    side-by-side = true
    line-numbers-left-format = "{nm:>4} "
    line-numbers-right-format = "{np:>4} "

Using Preset Themes

Theme Configuration
# Check available themes
delta --show-themes

# Popular presets
[delta]
    features = decorations

[delta "decorations"]
    commit-decoration-style = bold yellow box ul
    file-style = bold yellow ul
    file-decoration-style = none
    hunk-header-decoration-style = cyan box ul

# Monokai-style theme
[delta]
    syntax-theme = "Monokai Extended"

# GitHub-style theme
[delta]
    syntax-theme = "GitHub"

# Dracula-style theme
[delta]
    syntax-theme = "Dracula"

Integration with Other Tools

lazygit Integration

lazygit Configuration
# ~/.config/lazygit/config.yml
git:
  paging:
    colorArg: always
    pager: delta --dark --paging=never

tig Integration

tig Configuration
# ~/.tigrc
set diff-highlight = true
set pager = delta

git blame Integration

blame Configuration
# Display git blame output with delta
[blame]
    pager = delta

# Or use directly
git blame file.rs | delta

Comparison with Similar Tools

Featuredeltadiff-so-fancycolordiff
Syntax highlightingYes (many languages)NoNo
Side-by-sideYesNoNo
Word-level diffYesYesNo
Line numbersYesNoNo
CustomizationHighMediumLow

Tips

  • *Setting navigate = true allows jumping between files with n/N keys
  • *When terminal width is narrow, setting side-by-side = false improves readability
  • *Use delta --show-syntax-themes to preview themes
  • *In CI environments like GitHub Actions, set --paging=never
  • *Setting hyperlinks = true makes file paths clickable links (requires compatible terminal)
  • *Uses the same syntax definitions as bat, allowing consistent display with bat
Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More