What the command does
Microsoft Learn says that starting in Visual Studio 2026 version 18.11, you can compare a commit with your working tree across the whole repository, rather than just one file. The problem it solves is simple. Comparing two commits leaves out work you haven't committed yet. This command puts the old commit on one side and your current local state on the other.
The selected commit is the baseline. Visual Studio lists every file that differs between that baseline and your working tree. That is not the same as the files the chosen commit touched. Later commits and uncommitted edits can all appear in the list. Don't read the list as "what this commit changed". It means "how my code differs from this point in history".
How to use it
Right-click the commit you want in commit history or the branch list. Select Compare with Working Tree. In the compare view, select changed files to inspect their diffs against your working tree. You don't need to check out the commit to do this. Microsoft's blog post adds that you also don't have to leave your current branch.
A successful run opens a compare view listing the differing files. Selecting a file shows its diff.
Three commands that sound alike
| Task | Command | What is compared |
|---|---|---|
| One file against your working tree | Solution Explorer, Git > View History, right-click a commit, Compare with Working Tree | The file's committed version against the working-tree version |
| A whole commit against your working tree | Commit history or branch list, right-click a commit, Compare with Working Tree | The commit as baseline against the whole working tree (needs 18.11 or later) |
| Two committed states | Ctrl-select two commits, right-click, Compare Commits | Commit against commit, with no live working tree |
For the file-level version, Visual Studio shows the committed version on the left and the working-tree version on the right. The diff includes committed and uncommitted changes made since the selected commit. The documentation describes the repository-level command as the same idea applied across the repository. It does not spell out whether the compare view keeps the same left/right layout.
When it helps
These are practical uses, drawn from how the comparison works rather than from Microsoft's claims:
- Chasing a regression. You know a behavior worked at a certain commit. You can see everything that has changed since, including your unsaved-to-history experiments, without disturbing your branch.
- Reviewing accumulated work. Before opening a pull request, you can check your tree against a known baseline.
- Avoiding a checkout. You don't need to stash or switch branches just to look at old code.
The command only shows differences. It doesn't tell you which change caused a bug. If you need to run the old code, Microsoft's documentation still points you to checking out a commit, which puts you in a detached HEAD state.
Availability
This is the part to read carefully. Microsoft documents the feature for Visual Studio 2026 version 18.11. The Visual Studio 2026 Insiders release notes also describe the feature. In the material reviewed here, I could not confirm that 18.11 has shipped as a generally available release. Check Help > About or the Visual Studio Installer before hunting for the menu item. If you don't see it, you are probably on an earlier build.
Several details are not covered in the documentation I reviewed:
- performance on very large repositories
- behavior with merge conflicts
- keyboard shortcuts
- support for other Git providers
Command-line equivalent
If you want a workaround on an earlier build, Git itself can do something similar. Running git diff <commit> compares the working tree with a given commit. That is general Git behavior, and I haven't tested it against the Visual Studio command. Microsoft's post says the feature came from a community request on Developer Community.
Bottom line
This is a small feature that fills a real gap between commit-to-commit diffs and single-file comparisons. It works from the history list, needs no checkout, and covers committed and uncommitted changes. Confirm you're on 18.11 or later, and remember that the baseline is the commit you chose.
References
- Compare today’s code with an earlier commit Visual Studio Blog · 2026-10-21T14:00:30+00:00
- Browse repos, compare branches & commits - Visual Studio (Windows) | Microsoft Learn learn.microsoft.com
- Visual Studio Insiders release notes | Microsoft Learn learn.microsoft.com