Review and refine Git diffs before you push
git diff shows changes. difi helps you review them.
- ⚡️ Instant — Built in Go. Launches immediately with no daemon or indexing.
- 🎨 Structured — A clean file tree and focused diffs for fast mental parsing.
- 🧠 Editor-Aware — Jump straight to the exact line in
nvim/vimto fix issues. - ⌨️ Keyboard-First — Navigate everything with
h j k l. No mouse required.
brew install difigo install github.com/oug-t/difi/cmd/difi@latestBinary (pre-built):
pikaur -S difi-binBuild from source:
pikaur -S difi- Download the binary from Releases and add it to your
$PATH.
- Run difi in any Git repository against main:
cd my-project
difiPiping & Alternative VCS
- You can also pass raw diffs directly into
difivia standard input. This is perfect for patch files or other version control systems like Jujutsu:
# Review a saved patch file
cat changes.patch | difi
# Review changes in Jujutsu (jj)
jj diff --git | difi
# Pipe standard git diff output
git diff | difi| Key | Action |
|---|---|
Tab |
Toggle focus between File Tree and Diff View |
j / k |
Move cursor down / up |
h / l |
Focus Left (Tree) / Focus Right (Diff) |
e / Enter |
Edit file (opens editor at selected line) |
? |
Toggle help drawer |
q |
Quit |
- The "Unix philosophy" approach: Uses the industry-standard Git wrapper to provide a robust, side-by-side editing experience.
- Side-by-Side Editing: Instantly opens a vertical split (:Gvdiffsplit!) against the index.
- Merge Conflicts: Automatically detects conflicts and opens a 3-way merge view for resolution.
- Config: Add the line below to if using lazy.nvim.
{
"tpope/vim-fugitive",
cmd = { "Gvdiffsplit", "Git" }, -- Add this line
}Get the ultimate review experience with difi.nvim.
- Auto-Open: Instantly jumps to the file and line when you press
ein the CLI. - Visual Diff: Renders diffs inline with familiar green/red highlights—just like reviewing a PR on GitHub.
- Interactive Review: Restore a "deleted" line by simply removing the
-marker. Discard an added line by deleting it entirely. - Context Aware: Automatically syncs with your
difisession target.
To use difi as a native git command (e.g., git difi), add it as an alias in your global git config:
git config --global alias.difi '!difi'Now you can run it directly from git:
git difigit clone https://github.com/oug-t/difi
cd difi
go run cmd/difi/main.goContributions are especially welcome in:
- diff.nvim rendering edge cases
- UI polish and accessibility
- Windows support
Made with ❤️ by oug-t
