Fetched Diff — inline Git diff vs your fetched upstream
See, right inside the editor, how your code differs from the latest fetched commit. By default that is your branch's upstream, e.g. origin/main after a git fetch. It is not the same as VS Code's built-in gutter, which only shows uncommitted changes against HEAD. Fetched Diff includes your local commits, staged and unstaged edits, and even unsaved changes in the buffer. You see everything that is different from what's on the remote right now.
Features
- Inline diff in the editor. Added lines are green, modified lines are blue, and removed lines get a red marker with a "⊖ N lines removed" hint. These update live as you type.
- Hover a change to see the original code from the fetched commit, with one-click Revert to fetched and Side-by-side links.
- Repository details. The status bar shows the base ref, ahead/behind counts and
+added −removed for the current file. Click it for branch, HEAD commit, base commit, remotes, last-fetch time and uncommitted count. Selecting a value copies it.
- Changes vs Fetched view in the Source Control sidebar. It lists every file that differs from the fetched commit: committed, staged, unstaged and untracked. Click a file for a side-by-side diff.
- Fetch & refresh from the view title, the status-bar menu or the command palette. It uses VS Code's Git extension, so your saved credentials and SSH agent work. The extension also notices fetches, commits and checkouts made from a terminal.
- Choose any base: a remote branch, a tag, a SHA, or an expression such as
HEAD~3.
How the base commit is chosen
- The
fetchedDiff.baseRef setting, if set (e.g. origin/develop)
- The current branch's upstream (
@{upstream}), which is what git fetch updates
origin/HEAD, the remote's default branch (used on a detached HEAD or a branch without upstream)
HEAD (repository without a remote)
Commands
| Command |
Default key |
| Fetched Diff: Git Fetch & Refresh Diff |
|
| Fetched Diff: Show Repository Details |
click status bar |
| Fetched Diff: Open Side-by-Side Diff vs Fetched Commit |
editor title button |
| Fetched Diff: Choose Base Ref… |
|
| Fetched Diff: Go to Next / Previous Change |
Alt+F5 / Shift+Alt+F5 |
| Fetched Diff: Toggle Inline Diff |
|
| Fetched Diff: Refresh |
|
Settings
| Setting |
Default |
|
fetchedDiff.enabled |
true |
Show inline decorations |
fetchedDiff.baseRef |
"" |
Ref to compare against (empty = upstream) |
fetchedDiff.highlightWholeLine |
true |
Tint changed lines, not just the gutter |
fetchedDiff.showDeletedLineHints |
true |
Show the "lines removed" hint text |
fetchedDiff.autoFetchMinutes |
0 |
Auto git fetch every N minutes (0 = off) |
Colors can be themed with fetchedDiff.addedBackground, fetchedDiff.modifiedBackground and fetchedDiff.deletedHintForeground under workbench.colorCustomizations.
Requirements
git must be on your PATH. The extension works with any number of repositories and nested repos in a workspace.
Development
npm install
npm run build # bundle to dist/extension.js
npm run typecheck
npm test # logic tests against a throwaway repo with a remote
Press F5 in VS Code to launch an Extension Development Host.
Packaging & publishing
npx @vscode/vsce package --no-dependencies # → fetched-diff-<version>.vsix
npx @vscode/vsce login <publisher-id>
npx @vscode/vsce publish --no-dependencies