Git Branch Differ is a Solution Explorer Filter which, when applied, only shows those files in your Solution Explorer that were Added/Modified/Renamed in your working branch as compared to a "reference" branch/commit/tag of your choice, typically a master/main branch.
After the filter is applied, you can open a diff for any file from Solution Explorer to view what changed.
Install the plugin from the Visual Studio Marketplace, or grab it from within Visual Studio's Manage Extensions window by searching "Git Branch Differ". You can also try the latest CI build. Open the latest CI run, download the artifact, unzip and run GitBranchDiffer.vsix.
- Click the
Branch Diff Filter
in the Solution Explorer Filters dropdown to only see files that were changed in the working branch.
By default, the extension will use master/main or the first branch found in repo as the Git reference to compare with.
- Once the filter is applied, right-click on a file in Solution Explorer, then click
Open diff with Git reference
.
This opens a new tab, displaying the diff of the file's content in working branch vs. file's content in reference branch/commit/tag.
- You can set your own Git reference from the Git reference configuration window.
Click the button shown in the screenshot below.
- Type in the branch name/commit-SHA/tag name in the text box at the bottom, or select a reference from the list of branches/recent commits/tags, then press OK. Re-apply the
Branch Diff Filter
filter in Solution Explorer.
The extension was created to make reviewing pull requests in .NET projects easier, as jumping/navigating via code (classes, methods, properties and their references inside the solution) is possible when the comparison view is "native" to Visual Studio, as opposed to only text-based code comparison on platforms like Github.
Note that GitBranchDiffer filter does not support displaying files that were deleted in the working branch.
All contributions are welcome. To report a bug, please use the bug template
git clone --recurse-submodule https://github.com/sajalverma17/GitBranchDiffer.git
cd GitBranchDiffer
Open the GitBranchDiffer.sln
and build the solution.
To debug the extension in VS2019, open GitBranchDiffer.sln
in VS2019 or VS2022 and set GitBranchDiffer2019
as the Startup Project.
To debug the extension in VS2022, open GitBranchDiffer.sln
in VS2022 and set GitBranchDiffer
as the Startup Project.
After freshly cloning, if you run into this TypeInitializationException while debugging, try deleting the Extensions folder found under this directory:
%LocalAppData%\Microsoft\VisualStudio\16.0_XXXXXXXXExp
. For VS2022 debugging, the path would be%LocalAppData%\Microsoft\VisualStudio\17.0_XXXXXXXXExp
.
Thanks to Thomas Koch @tommes for the bugfix
Microsoft added the Git Branch Compare feature in Visual Studio 2022 (Version 17.2), so this plugin might not add much value anymore. With that said, I will continue to upgrade to new versions of VS, maintain it and accept PRs.