explaingit

so-fancy/diff-so-fancy

📈 Trending18,023PerlAudience · developerComplexity · 2/5ActiveLicenseSetup · easy

TLDR

A tool that reformats git diff output with cleaner styling, word-level highlighting, and better readability so code changes are easier to scan.

Mindmap

mindmap
  root((repo))
    What it does
      Reformats git diff
      Highlights word changes
      Removes clutter
    How to use
      Configure as git pager
      Works with git diff
      Pipe standalone diff
    Installation
      npm, Homebrew, Nix
      Scoop, Linux repos
      From source
    Tech details
      Perl script
      Color configuration
      Works with git commands

Things people build with this

USE CASE 1

Review code changes faster by seeing word-level diffs instead of full-line highlighting.

USE CASE 2

Set up as your default git diff viewer to automatically improve readability across all projects.

USE CASE 3

Pipe output from the standard diff command through diff-so-fancy for cleaner formatting outside git.

Tech stack

Perl

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

diff-so-fancy is a tool that makes the output of git diff, the command that shows what changed between versions of code, much easier for humans to read. By default, git diff shows changes as plain text with plus and minus signs at the start of each line, which can be hard to scan quickly. diff-so-fancy reformats this output with cleaner visual styling, removes the leading symbols, simplifies the file header lines, and highlights the specific words that changed within each line rather than just marking the entire line. You configure it by telling git to use diff-so-fancy as its "pager" (the program that displays output). After that, it works automatically whenever you run git diff, git show, or other diff-generating commands. The readme also provides recommended color settings that improve contrast for the highlighted portions. diff-so-fancy can also be used independently of git by piping the output of the standard diff command through it. It is a Perl script that can be installed from its source repository, through package managers including npm, Homebrew, Nix, Scoop, and others, or from Linux distribution repositories.

Copy-paste prompts

Prompt 1
How do I install and configure diff-so-fancy as my default git diff viewer?
Prompt 2
Show me how to use diff-so-fancy with the standard diff command instead of git.
Prompt 3
What color settings does diff-so-fancy recommend for better contrast when viewing diffs?
Prompt 4
How can I pipe git diff output through diff-so-fancy to see word-level changes highlighted?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.