针对 git diff 的交互式并排文件审查,支持按文件导航、垂直和水平滚动、语法高亮显示以及添加/删除行提示
My name is deff
deff is a Rust TUI: interactive, side-by-side file review for git diffs with per-file navigation, vertical and horizontal scrolling, syntax highlighting, and added/deleted line tinting.
Choose one install method:
cargo install deff
curl -fsSL https://raw.githubusercontent.com/flamestro/deff/main/install.sh | bash
Installer script source: https://github.com/flamestro/deff/blob/main/install.sh
The script checks for cargo, clones this project into a temporary directory, installs it, and removes the temporary checkout.
Bundled syntax grammars are compiled into the binary, so removing the checkout does not affect highlighting.
If you have local edits (including untracked files) and want to review them before committing, run:
deff --only-uncommitted
This opens the side-by-side review so you can check exactly what changed in your working tree.
upstream-ahead strategy (default) to compare local branch changes against its upstreamrange strategy for explicit --base / --head comparison--include-uncommitted mode to include working tree and untracked files--only-uncommitted mode to compare working tree and untracked files against HEADh/j/k/l, g/G, Ctrl+u/Ctrl+d)/ + Enter, then n / N to navigate matches)r) with local persistence under .gitSingle-line change view:
Multi-line change view:
deff
deff --strategy upstream-ahead
deff --strategy range --base origin/main --head HEAD
deff --strategy range --base origin/main --include-uncommitted
deff --only-uncommitted
deff --theme dark
deff --config ~/.config/deff/config.toml
Show help:
deff --help
Prerequisites:
cargo)gitBuild locally:
cargo build --release --locked
./target/release/deff --help
Optionally install it to your local Cargo bin path:
cargo install --path .
deff --help
Run it inside any git repository you want to review:
cd /path/to/your/repo
# default: compare local branch commits vs upstream
deff
# explicit range
deff --base origin/main --head HEAD
# include uncommitted + untracked files
deff --base origin/main --include-uncommitted
# compare only working tree + untracked files against HEAD
deff --only-uncommitted
If your branch has no upstream configured, use the explicit --base flow.
Theme selection:
deff prefers a dark syntax theme (better for black/dark terminals).--theme auto|dark|light to control rendering for your terminal.--theme takes precedence over DEFF_THEME=dark|light.Key binding config:
~/.config/deff/config.toml or $XDG_CONFIG_HOME/deff/config.toml--config to load specific config file--no-config to ignore config filesquit, previous_file, next_file, scroll_up, scroll_down, page_up, page_down, top, bottom, search, next_match, previous_match, next_hunk, previous_hunk, toggle_reviewed"j"), arrows ("left"), paging keys ("pageup"), modifiers ("ctrl-u", "alt-j")[keybindings] replace that action's defaults; omitted actions keep default bindings[keybindings]
page_down = "J"
page_up = "K"
Custom syntax grammars:
deff loads syntect defaults, bundled deff grammars, plus any extra .sublime-syntax files found in:assets/syntaxes (current working directory).deff/syntaxes (current working directory)*.sublime-syntax file added under this repo's assets/syntaxes is auto-bundled at build time.Search and reviewed workflow:
/ to enter a search query for the current file (searches both panes).Enter to apply the query, then use n / N to jump matches.r to mark the current file reviewed/unreviewed..git/deff/reviewed/ and keyed by comparison scope + file content hash.This repo ships with .github/workflows/bump-version.yml.
main (excluding commits authored by github-actions[bot])feat: -> next minor, fix:/chore:/docs: -> next patch) and updates Cargo.toml/Cargo.lock when neededvX.Y.Z tag and GitHub releaseSee CONTRIBUTING.md for local setup, commit message conventions, and release/versioning rules.
For a module-level map and extension plan, see docs/architecture.md.
暂无开放 Issues,或尚未同步最近议题。