Linux command
revdiff 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Review uncommitted changes
revdiff
Review changes
revdiff [main]
Review only staged
revdiff --staged
Review the last commit
revdiff HEAD~1
Browse all
revdiff --all-files
Review changes
revdiff [main] [feature]
Include only
revdiff --include [src/api/]
Review content
echo "[text]" | revdiff --stdin
说明
revdiff is a terminal user interface for reviewing diffs, files, and documents with inline annotations. It provides a two-pane layout with a file tree on the left and a colorized diff viewport on the right, supporting navigation, annotation, and syntax highlighting. Annotations can be placed on any line in the diff — added, removed, or context lines — as well as file-level notes. On quit, annotations are output as structured text to stdout (or a file with -o), making it straightforward to pipe results into AI agents, scripts, or other tools. revdiff auto-detects the version control system and works with both Git and Mercurial repositories. It supports diffs, blame, and untracked file listing across both backends. When a diff contains exactly one file, the tree pane is automatically hidden.
参数
- --staged
- Show staged changes only
- -A, --all-files
- Browse all git-tracked files, not just changed ones
- --stdin
- Review content from stdin as a scratch buffer
- --stdin-name _name_
- Synthetic filename for stdin content (default: scratch-buffer)
- -I, --include _prefix_
- Include only files matching path prefix
- -X, --exclude _prefix_
- Exclude files matching path prefix
- -F, --only _path_
- Show only specific files by path
- -o, --output _file_
- Write annotations to file instead of stdout
- --tree-width _n_
- File tree panel width in units 1-10 (default: 2)
- --tab-width _n_
- Spaces per tab character (default: 4)
- --wrap
- Enable line wrapping in diff view
- --collapsed
- Start with diffs collapsed
- --line-numbers
- Show line numbers in gutter
- --blame
- Show blame gutter on startup
- --word-diff
- Highlight intra-line word changes
- --cross-file-hunks
- Allow navigation across file boundaries
- --no-colors
- Disable all colors and syntax highlighting
- --no-status-bar
- Hide the status bar
- --no-confirm-discard
- Skip confirmation when discarding annotations
- --chroma-style _theme_
- Syntax highlighting theme (default: catppuccin-macchiato)
- --theme _name_
- Load color theme from config directory
- --config _path_
- Path to config file (default: ~/.config/revdiff/config)
- --keys _path_
- Path to keybindings file
- -V, --version
- Show version information
FAQ
What is the revdiff command used for?
revdiff is a terminal user interface for reviewing diffs, files, and documents with inline annotations. It provides a two-pane layout with a file tree on the left and a colorized diff viewport on the right, supporting navigation, annotation, and syntax highlighting. Annotations can be placed on any line in the diff — added, removed, or context lines — as well as file-level notes. On quit, annotations are output as structured text to stdout (or a file with -o), making it straightforward to pipe results into AI agents, scripts, or other tools. revdiff auto-detects the version control system and works with both Git and Mercurial repositories. It supports diffs, blame, and untracked file listing across both backends. When a diff contains exactly one file, the tree pane is automatically hidden.
How do I run a basic revdiff example?
Run `revdiff` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --staged do in revdiff?
Show staged changes only