Linux command
diff-so-fancy 命令
文本
Uses pipes, overwrite, or deletion. Check paths and options first.
命令示例
Pipe git diff
git diff | diff-so-fancy
Configure git
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
Use as git diff tool
git config --global interactive.diffFilter "diff-so-fancy --patch"
Show file changes
diff-so-fancy < [changes.diff]
说明
diff-so-fancy transforms git diff output into a more human-readable format. It improves the visual presentation of diffs with better line highlighting, cleaner headers, and removed chunk markers. The tool uses terminal colors effectively to highlight what changed within lines, making code reviews faster and easier. It's designed as a git pager replacement.
参数
- --patch
- Use patch-compatible output mode.
- --no-colors
- Disable color output.
- --colors
- Enable color output.
- --set-defaults
- Configure git to use diff-so-fancy.
FAQ
What is the diff-so-fancy command used for?
diff-so-fancy transforms git diff output into a more human-readable format. It improves the visual presentation of diffs with better line highlighting, cleaner headers, and removed chunk markers. The tool uses terminal colors effectively to highlight what changed within lines, making code reviews faster and easier. It's designed as a git pager replacement.
How do I run a basic diff-so-fancy example?
Run `git diff | diff-so-fancy` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --patch do in diff-so-fancy?
Use patch-compatible output mode.