diff-so-fancy
Perl script that reformats git diff and unified diff output for readability, with cleaner headers, hunk markers, and stripped +/- symbols.
diff-so-fancy is a diff post-processor. It reads unified diff output, either from git or from the standard diff -u command, and reformats it to be easier to read. It is used as a pager filter for git, or at the end of a pipe such as diff -u file_a file_b | diff-so-fancy. Recursive diffs are supported too: diff --recursive -u /path/folder_a /path/folder_b | diff-so-fancy.
For git, you set it as the core pager with git config --global core.pager "diff-so-fancy | less --tabs=4 -RF". You can also set it as the interactive diff filter with git config --global interactive.diffFilter "diff-so-fancy --patch". The output simplifies git's hunk header chunks, draws ruler lines around file names, can remove the leading + and - symbols, and colorizes the first block of empty lines.
Behavior is controlled through git config keys under the diff-so-fancy. namespace. These are markEmptyLines, changeHunkIndicators, stripLeadingSymbols, useUnicodeRuler, rulerWidth, fileNameRulerShape, shortHeaders and semIntegration. shortHeaders collapses the file name and line number into a single line. semIntegration adds the summary from the sem tool to the header of each changed file. The README lists Delta, difftastic, and Lazygit (which has a diff-so-fancy integration) as related tools. The tool is aimed at developers who read diffs in the terminal.

Alternatives & related tools
Git Extras
A collection of extra git subcommands, including git-ignore, git-setup, git-changelog, git-release, git-effort, git-squash and git-pull-request.
pre-commit
Framework for managing and maintaining multi-language pre-commit hooks in Git repositories.
git-lfs
Git extension for managing large files by storing them outside the repository with pointer files
gitui
Terminal-based Git GUI for staging, committing, branching, and repository management with keyboard-only control
git-secrets
Prevents committing passwords and sensitive information to git repositories using pattern matching and hooks
add a badge to your README
Maintain diff-so-fancy? Show that it's featured on trmn. The badge links back to this page.
[](https://www.trmn.sh/tools/diff-so-fancy?utm_source=badge)<a href="https://www.trmn.sh/tools/diff-so-fancy?utm_source=badge"><img src="https://www.trmn.sh/badge/diff-so-fancy.svg" alt="Featured on trmn" height="20"></a>