Repolode
banga

banga/git-split-diffs

A git pager that renders diffs side by side with syntax highlighting in the terminal, GitHub-style.

Stars
2,745
Forks
51
Open issues
14
Last commit
27 days ago

What is it?

git-split-diffs is a pager filter for git that turns unified diffs into GitHub-style split views, with old and new versions shown side by side. It runs in the terminal and can be set as git's core.pager so that git diff, git log -p and similar commands use it automatically, or it can be piped from git diff manually.

Syntax highlighting is provided by shiki and uses the same grammars and themes as VS Code. Changed words within lines are highlighted by default. The tool ships with several built-in themes, including GitHub Light and Dark, Solarized, Nord-based Arctic, and monochrome options, and supports custom themes loaded from a directory.

The layout adapts to terminal width: lines wrap by default, and when the terminal is narrower than a configurable minimum line width, the output falls back to a unified diff.

Key features

  • 01Side-by-side diffs in GitHub style, usable as git's core.pager.
  • 02Syntax highlighting via shiki, using VS Code grammars and themes.
  • 03Inline highlighting of changed words within lines, with an option to disable it.
  • 04Several built-in themes and support for custom theme files.
  • 05Automatic fallback to unified diffs on narrow terminals.

Use cases

  • Reviewing git diff and git log -p output in the terminal with easier-to-read side-by-side changes.
  • Setting up a more readable default diff view for git across a team or machine via git config.
  • Browsing code history over SSH in a terminal without a GUI diff tool.

Quick start

  1. 1

    Install globally with npm

    npm install -g git-split-diffs
  2. 2

    Configure git to use it as the pager

    git config --global core.pager "git-split-diffs --color | less -RFX"

Things to know

  • Requires Node.js version 14 or newer.
  • Falls back to unified diffs on terminals narrower than 160 characters by default.

In collections

Topics

FAQ

What is git-split-diffs?
A git pager that renders diffs side by side with syntax highlighting in the terminal, GitHub-style. git-split-diffs is a pager filter for git that turns unified diffs into GitHub-style split views, with old and new versions shown side by side. It runs in the terminal and can be set as git's core.pager so that git diff, git log -p and similar commands use it automatically, or it can be piped from git diff manually.
Is git-split-diffs free to use? What license does it have?
git-split-diffs is open source under the MIT license. Check the license terms before using it in commercial products.
Is git-split-diffs still maintained?
Actively maintained. The last commit to git-split-diffs was on Oct 11, 2026.
What can I use git-split-diffs for?
Reviewing git diff and git log -p output in the terminal with easier-to-read side-by-side changes. Setting up a more readable default diff view for git across a team or machine via git config. Browsing code history over SSH in a terminal without a GUI diff tool.
How do I install git-split-diffs?
Install globally with npm: npm install -g git-split-diffs Configure git to use it as the pager: git config --global core.pager "git-split-diffs --color | less -RFX"
Where can I get git-split-diffs?
The source code and installation instructions are on GitHub: https://github.com/banga/git-split-diffs

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects