delta

dandavisonMIT活跃维护

给 git diff、grep、rg 和 blame 输出加上语法高亮和并排对比的终端分页器,让代码审查和变更查看更清晰易读。

A syntax-highlighting pager for git, diff, grep, rg --json, and blame output

0.20.1发布于 2026-10-04 19:38 UTC32,712star +27 / 7 天618fork同步于 2026-11-10 17:21 UTC

怎么上手

由 README 提炼,执行前请确认
git config --global core.pager delta
git config --global interactive.diffFilter 'delta --color-only'
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

给 git diff、blame、grep 输出加语法高亮和并排视图的分页器,让看 diff 更省力

给 git diff、grep、rg 和 blame 输出加上语法高亮和并排对比的终端分页器,让代码审查和变更查看更清晰易读。

核心能力

  • 用 bat 同款主题做语言语法高亮
  • 用 Levenshtein 编辑推断做词级 diff 高亮
  • 支持并排视图并自动折行长行
  • n/N 键在 diff 与 log -p 各段间跳转
  • 高亮 rg、git grep、grep 的搜索结果

容易踩的坑

多数包管理器里包名是 git-delta,但可执行文件叫 delta;需要手动写入 ~/.gitconfig 或执行 git config 才会生效;并排视图、行号、navigate 等均为需显式开启的配置项

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本0.20.1
  1. 0.20.1最新正式版2026-10-04 · 2026-10-04 19:38 UTC

    Patch release fixing #2270

  2. 0.20.02026-10-04 · 2026-10-04 15:36 UTC
    查看更新说明

    This release adds support for the OSC1717 diff-line metadata spec by @stefanhaller. This is an exciting change: it allows TUIs such as lazygit to use delta to render diffs in a UI with keybindings for staging/unstaging etc, with the delta rendering able to use arbitrary features such as side-by-side mode and decorations.

    This release also looks to be the beginning of AI-generated code in delta. Most of the PRs in this release had large amounts of AI agent-assistance, e.g. #2181, #2261, #2266, #2199, #2240. One looks to have been contributed directly by an AI agent.

    What's Changed

    New Contributors

    Full Changelog: https://github.com/dandavison/delta/compare/0.19.2...0.20.0

  3. 0.19.22026-03-28 · 2026-03-28 19:50 UTC
    查看更新说明

    This is a patch release providing rebuilt binaries compatible with Debian 12 (the 0.19.0 and 0.19.1 .deb packages required glibc 2.39, which is only available in Debian 13).

    What's Changed

  4. 0.19.12026-03-22 · 2026-03-22 15:20 UTC
    查看更新说明

    This patch release fixes a release automation bug: release 0.19.0 did not include all release binaries.

    What's Changed

    Full Changelog: https://github.com/dandavison/delta/compare/0.19.0...0.19.1

  5. 0.19.02026-03-20 · 2026-03-20 01:25 UTC
    查看更新说明

    Tons of improvements; thanks very much to all delta contributors.

    This release is missing several binaries due to a bug in the GitHub Actions release workflow. Please use https://github.com/dandavison/delta/releases/tag/0.19.1 instead.

    What's Changed

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Get Started

    Install it (the package is called "git-delta" in most package managers, but the executable is just delta) and add this to your ~/.gitconfig:

    [core]
        pager = delta
    
    [interactive]
        diffFilter = delta --color-only
    
    [delta]
        navigate = true  # use n and N to move between diff sections
        dark = true      # or light = true, or omit for auto-detection
    
    [merge]
        conflictStyle = zdiff3
    

    Or run:

    git config --global core.pager delta
    git config --global interactive.diffFilter 'delta --color-only'
    git config --global delta.navigate true
    git config --global delta.dark true  # or `delta.light true`, or omit for auto-detection
    git config --global merge.conflictStyle zdiff3
    

    Delta has many features and is very customizable; please see delta -h (short help) or delta --help (full manual), or the online user manual.

    Features

    • Language syntax highlighting with the same syntax-highlighting themes as bat
    • Word-level diff highlighting using a Levenshtein edit inference algorithm
    • Side-by-side view with line-wrapping
    • Line numbering
    • n and N keybindings to move between files in large diffs, and between diffs in log -p views (--navigate)
    • Improved merge conflict display
    • Improved git blame display (syntax highlighting; --hyperlinks formats commits as links to hosting provider etc. Supported hosting providers are: GitHub, GitLab, SourceHut, Codeberg)
    • Syntax-highlights grep output from rg, git grep, grep, etc
    • Support for Git's --color-moved feature.
    • Code can be copied directly from the diff (-/+ markers are removed by default).
    • diff-highlight and diff-so-fancy emulation modes
    • Commit hashes can be formatted as terminal hyperlinks to the hosting provider page (--hyperlinks). File paths can also be formatted as hyperlinks for opening in your OS.
    • Stylable box/line decorations to draw attention to commit, file and hunk header sections.
    • Style strings (foreground color, background color, font attributes) are supported for >20 stylable elements, using the same color/style language as git
    • Handles traditional unified diff output in addition to git output
    • Automatic detection of light/dark terminal background

    A syntax-highlighting pager for git, diff, and grep output

    Code evolves, and we all spend time studying diffs. Delta aims to make this both efficient and enjoyable: it allows you to make extensive changes to the layout and styling of diffs, as well as allowing you to stay arbitrarily close to the default git/diff output.

    Here's what git show can look like with git configured to use delta:

    Syntax-highlighting themes

    All the syntax-highlighting color themes that are available with bat are available with delta:

    Side-by-side view

    [User manual]

    [delta]
        side-by-side = true
    

    By default, side-by-side view has line-numbers activated, and has syntax highlighting in both the left and right panels: [config]

    Side-by-side view wraps long lines automatically:

    Line numbers

    [User manual]

    [delta]
        line-numbers = true
    

    Merge conflicts

    [User manual]

    Git blame

    [User manual]

    Ripgrep, git grep

    [User manual]

    Installation and usage

    Please see the user manual and delta --help.

    Live demo by Demoshell

    Maintainers