Git State & Revision DifferGit State & Revision Differ is a lightweight, high-performance Visual Studio Code extension that helps developers instantly differentiate between code that is Pushed, Committed (Unpushed), and Modified (Uncommitted) directly within the editor. It also gives you deep, seamless diffing capabilities: compare any specific line or your entire file with any Git commit (defaulting to the latest commit 🌟 Key Features1. 3-Tier Visual Code State DifferentiationNever wonder whether your changes are pushed to remote, committed locally, or still uncommitted:
2. Rich Line Hover CardHover your mouse over any line of code to instantly inspect:
3. Real-Time Status BarThe bottom-right status bar displays the active status of whatever line your cursor is currently on:
Clicking the status bar item immediately opens the commit comparison selector! 4. File Diff with Any Commit (Default: Latest Commit
|
| Setting | Type | Default | Description |
|---|---|---|---|
gitStateDiffer.decorations.showUnpushed |
boolean |
true |
Show gutter markers for unpushed commits. |
gitStateDiffer.decorations.showModified |
boolean |
true |
Show gutter markers for uncommitted modifications. |
gitStateDiffer.decorations.showPushed |
boolean |
false |
Show gutter markers for pushed code. |
gitStateDiffer.decorations.unpushedColor |
string |
#a855f7 |
Gutter and overview ruler color for unpushed code. |
gitStateDiffer.decorations.modifiedColor |
string |
#eab308 |
Gutter and overview ruler color for modified code. |
gitStateDiffer.decorations.pushedColor |
string |
#22c55e |
Gutter and overview ruler color for pushed code. |
gitStateDiffer.defaultDiffCommit |
string |
"HEAD" |
Default commit to compare against (HEAD, HEAD~1, @{u}). |
⌨️ Contributed Commands
| Command | Title | Location |
|---|---|---|
gitStateDiffer.compareFileWithCommit |
Git State: Compare File with Commit... | Editor Context Menu, Editor Title Bar |
gitStateDiffer.compareLineWithCommit |
Git State: Compare Selected Line(s) with Commit... | Editor Context Menu, Status Bar |
gitStateDiffer.refresh |
Git State: Refresh State | Command Palette (Ctrl+Shift+P) |
❓ Frequently Asked Questions
Q: How does the extension know which commits are unpushed?
The extension queries your Git upstream tracking branch (@{u} e.g., origin/main). It identifies all commits in @{u}..HEAD as unpushed. If your local branch does not have an upstream set yet, all local commits are considered unpushed.
Q: Does it slow down large repositories?
No! The extension uses native Git porcelain commands (git blame -p, git diff -U0) executed asynchronously with built-in debouncing (400ms) on typing, ensuring the editor remains buttery-smooth.
📄 License
This extension is licensed under the MIT License. See the included LICENSE.md for details.