Basics
difft <old> <new>
Diff two files
difft <dir1> <dir2>
Diff two directories recursively
difft - <file>
Read one side from stdin
difft <conflicted-file>
Diff the two sides of conflict markers
Needs a file containing <<<<<<< markers;
added in 0.50.
difft --help
List every option
difft --version
Print installed version
difft --list-languages
Show languages and extensions
difft --skip-unchanged <d1> <d2>
Show only files that differ
difft --sort-paths <d1> <d2>
Sort directory output by path
difft --exit-code <a> <b>
Exit 1 when there are changes
Without it the exit code is 0 even when files differ. 2 means
bad arguments or unreadable paths.
difft --check-only <a> <b>
Only report whether they differ
Display
difft --display side-by-side <a> <b>
Two columns (default)
difft --display side-by-side-show-both <a>
<b>
Two columns even for pure adds
difft --display inline <a> <b>
Single column, diff style
difft --display json <a> <b>
Machine-readable output
Unstable: also needs DFT_UNSTABLE set.
difft --context <n> <a> <b>
Lines of context around changes
difft --width <cols> <a> <b>
Force the wrapping width
difft --tab-width <n> <a> <b>
Spaces per tab
difft --color always <a> <b>
Force colour (also never / auto)
difft --background light <a> <b>
Colours for a light terminal
difft --syntax-highlight off <a> <b>
Plain colours, no highlighting
Languages and limits
difft --override '<glob>:<lang>'
<a> <b>
Force a language by file glob
Repeatable; first match wins. Language 'text' forces
plain text.
difft --override '*.conf:text' <a>
<b>
Treat matching files as text
difft --override-binary '<glob>' <a>
<b>
Always treat matching files as binary
difft --ignore-comments <a> <b>
Ignore comment changes
difft --strip-cr off <a> <b>
Keep carriage returns in the diff
difft --byte-limit <n> <a> <b>
Size above which it uses a line diff
Default 1000000 bytes.
difft --graph-limit <n> <a> <b>
Cap work on huge diffs
Default 3000000 graph vertices; raise it if you hit the
fallback.
difft --parse-error-limit <n> <a>
<b>
Parse errors tolerated before line diff
Git
git -c diff.external=difft diff
Use difft for one command
git config --global diff.external difft
Use difft for every git diff
git show --ext-diff <commit>
Show a commit with difft
show and log -p only use the external diff with --ext-diff.
git log -p --ext-diff
History with structural diffs
git diff --no-ext-diff
Back to the normal diff
git diff --ext-diff --staged
Staged changes with difft
git difftool -t difftastic
Run via difftool
git config --global difftool.prompt false
No prompt per file
git config --global diff.tool difftastic
Make difftastic the difftool
git config --global pager.difftool true
Page difftool output
GIT_EXTERNAL_DIFF=difft git diff
Select it by environment