difftastic
Structural diff tool with syntax awareness
TLDR
SYNOPSIS
difft [options] [path1] [path2]
DESCRIPTION
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.
PARAMETERS
--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
GIT INTEGRATION
Configure as git difftool:
CAVEATS
May be slower than traditional diff tools for very large files. Requires language grammars which may not support all edge cases. Binary files are not supported. Very deeply nested structures may have display issues.
HISTORY
difftastic was created by Wilfred Hughes to address the limitations of line-based diffing when working with code. It uses tree-sitter parsers to build syntax trees and compare them structurally. The project has gained significant popularity for providing clearer, more meaningful diffs.

