Linux command
difftastic 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Compare
difft [file1] [file2]
Compare
difft [dir1] [dir2]
Show
difft --git [file]
Use
git difftool --tool=difftastic
说明
difftastic is a structural diff tool that understands syntax. Unlike traditional line-based diff tools, it parses the code according to the programming language and shows changes based on the actual structure of the code. The tool supports over 20 programming languages and provides more accurate diffs by recognizing when code has moved versus changed. It can be used standalone or integrated with git as a difftool.
参数
- --color _MODE_
- Color mode: auto, always, never
- --display _MODE_
- Display mode: side-by-side, inline, or json
- --syntax-highlight _MODE_
- Syntax highlighting: on, off
- --check-only
- Exit with status 1 if files differ
- --strip-cr
- Strip carriage returns before comparing
- --context _N_
- Number of context lines to show
- --tab-width _N_
- Tab width for display (default: 4)
- --width _N_
- Maximum width of output display
- --list-languages
- Print all supported languages
- -h, --help
- Display help and exit
- -V, --version
- Display version and exit
FAQ
What is the difftastic command used for?
difftastic is a structural diff tool that understands syntax. Unlike traditional line-based diff tools, it parses the code according to the programming language and shows changes based on the actual structure of the code. The tool supports over 20 programming languages and provides more accurate diffs by recognizing when code has moved versus changed. It can be used standalone or integrated with git as a difftool.
How do I run a basic difftastic example?
Run `difft [file1] [file2]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --color _MODE_ do in difftastic?
Color mode: auto, always, never