π This is a short introduction to
difit
β a tiny CLI tool that lets you preview Git diffs in a GitHub-style interface, right from your local machine, with no installation required.
π€ Ever wish you could preview your GitHub diff before you push?
You're working on a feature, writing commits one by one.
Before opening a pull request, you want to double-check your changesβ
But git diff
in the terminal is messy, and pushing just to preview the PR feels wasteful.
Enter difit
: a lightweight CLI tool that lets you see your Git changes in a GitHub-like diff view, right in your browser β locally.
π What is difit?
difit
launches a local web UI that mimics GitHubβs diff view, showing you a full side-by-side comparison of your Git changes β all from a single command.
You donβt even need to install anything.
β‘ Quick start (no install needed)
You can run difit instantly using npx
:
npx difit
This will:
- Launch a local server
- Open your browser
- Show a visual diff between your current working tree and the last commit
πΌ Example screenshot
Looks just like GitHub, right?
π§© File-by-file diff
π Syntax highlighting
π Foldable sections
π§ Clean UI for peaceful reviews
π§ Other usage examples
Show staged & unstaged changes (default)
npx difit
Compare against another branch (e.g. main)
npx difit origin/main
Compare two commits explicitly
npx difit abc123..def456
Compare current changes
npx difit # HEAD commit changes
npx difit . # All uncommitted changes (staged + unstaged)
npx difit staged # Staged changes ready for commit
npx difit working # Unstaged changes only (cannot use compare-with)
π‘ Why use difit?
π Preview before pushing
See what your PR will look like before opening it.
π§Ό Spot mistakes early
Catch debug logs, leftover TODOs, or secret keys before they go public.
π Review your own work visually
Especially helpful before pushing large commits or squashed branches.
β Avoid pushing just to review
No need to create throwaway PRs just to read a diff.
π» Works offline
No GitHub token, no auth, no internet required.
πββοΈ About the author
difit is developed by @yoshiko_pg, who creates practical and elegant dev tools with minimalism and clarity in mind.
Check out the project here:
π https://github.com/yoshiko-pg/difit
π§ͺ Final thoughts
GitHubβs diff viewer is great β but itβs gated behind a push.
difit removes that barrier.
Now you can review your code visually before it ever leaves your machine.
Give it a try. Just one command:
npx difit
And youβre reviewing like itβs already a PR β¨
Top comments (0)