多数包管理器里包名是 git-delta,但可执行文件叫 delta;需要手动写入 ~/.gitconfig 或执行 git config 才会生效;并排视图、行号、navigate 等均为需显式开启的配置项
delta
dandavisonMIT活跃维护给 git diff、grep、rg 和 blame 输出加上语法高亮和并排对比的终端分页器,让代码审查和变更查看更清晰易读。
A syntax-highlighting pager for git, diff, grep, rg --json, and blame output
git config --global core.pager delta
git config --global interactive.diffFilter 'delta --color-only'README 未说明
给 git diff、blame、grep 输出加语法高亮和并排视图的分页器,让看 diff 更省力
给 git diff、grep、rg 和 blame 输出加上语法高亮和并排对比的终端分页器,让代码审查和变更查看更清晰易读。
核心能力
- 用 bat 同款主题做语言语法高亮
- 用 Levenshtein 编辑推断做词级 diff 高亮
- 支持并排视图并自动折行长行
- n/N 键在 diff 与 log -p 各段间跳转
- 高亮 rg、git grep、grep 的搜索结果
容易踩的坑
- 0.20.1最新正式版2026-10-04 · 2026-10-04 19:38 UTC
Patch release fixing #2270
- 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
- docs: fix DELTA_FEATURES markdown link and grammar by @Bartok9 in https://github.com/dandavison/delta/pull/2199
- Don't misparse git grep -h output as path=code by @albatrossflyon-coder in https://github.com/dandavison/delta/pull/2194
- docs: add link to a live browser demo by @kooler in https://github.com/dandavison/delta/pull/2229
- Take the terminal width from $COLUMNS when it is set by @stefanhaller in https://github.com/dandavison/delta/pull/2240
- Support OSC-1717 metadata by @stefanhaller in https://github.com/dandavison/delta/pull/2181
- Emit custom OSC-1717 commit C records by @dandavison in https://github.com/dandavison/delta/pull/2266
- Fix decorations wider than width by @stefanhaller in https://github.com/dandavison/delta/pull/2261
New Contributors
- @Bartok9 made their first contribution in https://github.com/dandavison/delta/pull/2199
- @albatrossflyon-coder made their first contribution in https://github.com/dandavison/delta/pull/2194
- @kooler made their first contribution in https://github.com/dandavison/delta/pull/2229
- @stefanhaller made their first contribution in https://github.com/dandavison/delta/pull/2240
Full Changelog: https://github.com/dandavison/delta/compare/0.19.2...0.20.0
- 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
- CD: pin GNU Linux builds to ubuntu-22.04 for Debian 12 compat by @dandavison in https://github.com/dandavison/delta/pull/2135
- 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
- Fix CD: replace defunct ubuntu-20.04 runners by @dandavison in https://github.com/dandavison/delta/pull/2129
Full Changelog: https://github.com/dandavison/delta/compare/0.19.0...0.19.1
- 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
- Do not double panic in FakeParentArgs::drop by @dvermd in https://github.com/dandavison/delta/pull/1856
- Improve blame file type detection (#1803) by @dvermd in https://github.com/dandavison/delta/pull/1829
- Use same example config in manual as README by @dandavison in https://github.com/dandavison/delta/pull/1879
- Clarify grep highlighter-related code by @dandavison in https://github.com/dandavison/delta/pull/1877
- Don't set colorMoved in introductory instructions by @dandavison in https://github.com/dandavison/delta/pull/1884
- Recommend zdiff3 merge.conflictStyle by @adamchainz in https://github.com/dandavison/delta/pull/1260
- Add themes
weeping-willow,mirthful-willowby @lvdh in https://github.com/dandavison/delta/pull/1864 - CI: switch to macos-13, as 12 will be unsupported soon by @th1000s in https://github.com/dandavison/delta/pull/1890
- Add optional capture-output writer to run_app() by @th1000s in https://github.com/dandavison/delta/pull/1889
- Center-align README content by @dandavison in https://github.com/dandavison/delta/pull/1893
- Redundant Option Checks, Unwrap Safety by @sharma-shray in https://github.com/dandavison/delta/pull/1892
- Add console commands for git configuration by @harmtemolder in https://github.com/dandavison/delta/pull/1896
- Honor pager path when checking less version by @dandavison in https://github.com/dandavison/delta/pull/1903
- Rename some variables by @dandavison in https://github.com/dandavison/delta/pull/1904
- Delete now-unused pricate homebrew formula step from Makefile (III) by @dvermd in https://github.com/dandavison/delta/pull/1830
- Support {host} in hyperlinks by @dandavison in https://github.com/dandavison/delta/pull/1901
- Allow multiple hyperlinks per line by @th1000s in https://github.com/dandavison/delta/pull/1909
- Clippy 1.83 by @th1000s in https://github.com/dandavison/delta/pull/1918
- Support external subcommands: rg, diff, git-show (etc.) by @th1000s in https://github.com/dandavison/delta/pull/1769
- Don't keep subcommand stdout around by @th1000s in https://github.com/dandavison/delta/pull/1920
- hyperlink commit hashes of length 7 as well by @th1000s in https://github.com/dandavison/delta/pull/1924
- clippy 1.84 fix by @th1000s in https://github.com/dandavison/delta/pull/1938
- chore(deps): update git2 to use libgit2 1.9 by @chenrui333 in https://github.com/dandavison/delta/pull/1930
- Suggest minimum bat version in manual by @ernstki in https://github.com/dandavison/delta/pull/1941
- Upgrade unicode-width to v0.1.14 (but still < 0.2.0) by @th1000s in https://github.com/dandavison/delta/pull/1937
- Update terminal-colorsaurus version to 0.4.8 by @rashil2000 in https://github.com/dandavison/delta/pull/1936
- Fix index out of bounds crash for '@@ @@' hunk header by @adamchainz in https://github.com/dandavison/delta/pull/1995
- Tune themes weeping-willow, mirthful-willow by @lvdh in https://github.com/dandavison/delta/pull/2011
- clippy 1.88 fixes by @injust in https://github.com/dandavison/delta/pull/2016
- Fix diff output when a diff ends with a mode change by @th1000s in https://github.com/dandavison/delta/pull/2023
- fix:
cargo install git-delta --lockedfails on systems with GCC 15 by @tquin in https://github.com/dandavison/delta/pull/2007 - Normalize
merge.conflictStylecasing by @injust in https://github.com/dandavison/delta/pull/2015 - Styled zero lines fix by @th1000s in https://github.com/dandavison/delta/pull/1916
- config: add setup instructions for Jujutsu (jj) vcs by @arjunmahishi in https://github.com/dandavison/delta/pull/2048
- all: fix clippy complaints by @charlievieth in https://github.c
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
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
nandNkeybindings to move between files in large diffs, and between diffs inlog -pviews (--navigate)- Improved merge conflict display
- Improved
git blamedisplay (syntax highlighting;--hyperlinksformats 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-movedfeature. - Code can be copied directly from the diff (
-/+markers are removed by default). diff-highlightanddiff-so-fancyemulation 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
[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
[delta]
line-numbers = true
Merge conflicts
Git blame
Ripgrep, git grep
Installation and usage
Please see the user manual and delta --help.