Diff BranchDiff Branch shows everything changed on the current Git branch, including committed work that VS Code's standard working-tree view no longer shows. It compares against the commit where the branch split from its base and presents the results in a dedicated Activity Bar view, alongside distinctive editor markers and the standard diff UI. Features
InstallationIn VS Code, open Extensions, search for Diff Branch, and select the extension published by Oddiss. You can also open its Marketplace listing. To install a downloaded Diff Branch requires VS Code 1.95 or later and Git available on your system path. UsageOpen a Git repository and select Diff Branch in the Activity Bar. The extension starts enabled and chooses a comparison base automatically. Select a changed file to open its diff. Use the title-bar icons to choose a comparison branch, choose a diff scope, switch layouts, or refresh. Click the Base row or run Diff Branch: Choose Comparison Branch to select a different base. Choose Automatic to return to automatic base selection. Click the Scope row or the filter icon to choose what the comparison includes:
The choice is saved per workspace in Choosing the current branch (or Use Diff Branch: Toggle Flat / Folder Tree or the tree icon in the view title to switch layouts. The choice is saved in Exclude generated or noisy files with glob patterns. Patterns without a slash match a filename at any depth; a leading slash anchors the match to the repository root:
Other commands:
Changed files appear only under Branch Changes in the dedicated Diff Branch view, keeping them separate from uncommitted changes in Source Control. The view uses its own accent colors and status icons; hover over a file for its full path and branch status. Selecting a file opens the full comparison. When there are no files to show, the view explains whether the comparison is empty, Diff Branch is disabled, no repository was found, or the comparison failed. Use the actions in the view to choose a base or scope, enable Diff Branch, open a repository folder, or retry. Hover over a failed comparison message for the error details. In multi-repository workspaces, each repository shows its own state and recovery actions. How automatic base detection worksThe Base row shows the selected ref and the short merge-base commit ID. Hover over it to see why that base was chosen and the full comparison commit. Click it to choose another base. The explanation distinguishes explicit settings, matching branch mappings, nearest ancestors, and default/previous-commit fallbacks. It is available in both layouts, including empty comparisons. By default, Diff Branch finds the closest local branch whose tip is an ancestor of the current branch. Given Git does not store explicit parent-branch metadata. This graph-based approach works naturally for branch stacks while their parent branch tips remain in the current branch's history. If no suitable local ancestor exists, Diff Branch falls back to:
The comparison commit is the merge-base of that ref and
You can also map branch names or wildcard patterns to their bases in User Settings. Exact branch names take priority over patterns:
Branch marker colorsMarkers are aligned to the current editor text, including unsaved edits. In committed/staged scopes, later edits can move a marker but do not become scoped changes themselves. Markers for lines that have since been replaced or deleted are hidden. While typing, markers are cleared and recalculated after a short pause. Diff Branch adds compact colored glyph-margin and overview-ruler markers instead of reusing VS Code's normal working-tree colors. The markers stay outside the code area so they do not compete with indentation or text. Customize them in User Settings:
Notes
Contributing and supportUse GitHub Issues for bugs and feature requests. For security issues, follow the security policy. For development setup and pull requests, see the contribution guide and code of conduct. Diff Branch is available under the MIT License. |