← Back to archive

Repo of the Day

aymanbagabas/drift: 👾 A git diff pager that actually wants to be looked at

Published: Aug 30, 2026

Open repository ↗

👾 A git diff pager that actually wants to be looked at - aymanbagabas/drift

Summary

Drift is a Rust-based terminal user interface for viewing git diffs, packaged as a drop-in pager for git diff and git show. It adds syntax highlighting, word-level change emphasis, a resizable file sidebar, jump-to-hunk navigation, in-file search, and a watch mode that repaints when your index or branch changes. The project is MIT-licensed and ships through Homebrew, Scoop, Cargo, npm, apt, yum, the AUR, Nix, and prebuilt binaries.

What it is useful for

Reviewing changes in a terminal without losing orientation. Plain git diff gives scrolling unified output; drift gives a clickable, drag-resizable file sidebar, a file-list modal, split or unified layouts, and word-level intra-line emphasis that makes a renamed variable inside a long line obvious. A live watch mode (-w) is pitched for use alongside AI coding agents: leave drift -w open in a split and press F to freeze the view while you read.

Concrete invocations documented in the README include drift HEAD~3 for a single commit, drift main..feature for a range, drift --staged for the index, drift -A to include untracked files, and git diff | drift for piped input. As the git show pager, drift prints the commit's hash, author, date, and message above the diff, and falls back to plain terminal output for non-diff commands like git show HEAD:README.md or git show --stat.

How engineers can use it

Install via the package manager of your choice; the README documents every option. macOS/Linux: brew install aymanbagabas/tap/drift. Windows: add the Scoop bucket and scoop install drift. From source: cargo install drift-diff, or cargo binstall drift-diff to skip compilation. Arch: yay -S drift-diff-bin. Also documented: npm install -g @aymanbagabas/drift, apt and yum packages, Nix via NUR, and prebuilt binaries from the GitHub release.

Then set it as git's default pager:

git config --global pager.diff drift
git config --global pager.show drift

Daily-driver flags from the README: -U N for context lines, --ignore-whitespace, --diff-algorithm (myers, minimal, patience, histogram), --wrap/--no-wrap, --no-syntax, and -- PATHSPEC... to scope to specific paths. Pick a theme with git config --global drift.theme onedark (or dracula, nord, gruvbox-dark, solarized-dark, catppuccin-mocha, tokyonight, monokai); the default ansi borrows your terminal's 16 colors and intentionally leaves syntax highlighting and word-level emphasis off.

Two documented limitations: only seven syntect theme names are accepted (InspiredGitHub, the Solarized pair, and four base16 variants); anything else silently falls back to onedark. The ansi theme, by design, does not highlight code or word-level changes because 16 colors are too few to layer over diff colors. For full configuration beyond flags, the project points to CONFIG.md.