Description
diffr is a command-line tool that makes diffs easier to read. Line-based diffs can be hard to follow when lines are long or very similar, so diffr processes each hunk and recomputes the diff word by word. It then prints the result to the console with extra highlighting on top of the standard unified diff format, using Myers' longest common subsequence algorithm. The program behaves like a well-behaved Unix tool: it reads from stdin and writes to stdout, so you can use it once on any diff or add it to git through a section in your .gitconfig file. You can customize colors with the --colors flag, for removed text, added text and common segments, and add --line-numbers to show line numbers for each hunk. The README calls diffr an improvement on the diff-highlight script that ships with git, and notes that git's own --word-diff and --color-words options exist too. It is written in Rust, and you can install it from the AUR on Arch Linux or from Homebrew.…
Highlights
- Word-by-word highlighting inside each hunk
- Works as a Unix filter on stdin and stdout
- Git integration through .gitconfig
- Colors customizable with --colors
- Optional line numbers for each hunk
Ratings & Reviews
No ratings yet
Be the first to rate Diffr.
People also visit
Livediff
Real-time file monitoring with beautiful live diff visualization in the terminal
Diffr FAQ
What does diffr do?
It highlights diffs at the word level. It recomputes each hunk word by word and marks what changed, which is easier to read for long or very similar lines.
How do I install it?
Install it from the AUR on Arch Linux or from Homebrew, or build it from source with the Rust compiler. The README covers the latest published version and the development version.
How do I use it with git?
Add the section shown in the README to your .gitconfig file, or set it up from the command line, so git sends its diffs through diffr.
Can I change the colors?
Yes. The --colors flag lets you customize removed text, added text and common segments.
How is it different from git's own options?
The README calls diffr an improvement on the diff-highlight script that ships with git. It notes that git itself also offers --word-diff and --color-words.
What are the best Diffr alternatives?
Popular alternatives to Diffr include diffle, hunk and Livediff. See all Diffr alternatives






