Is there any way to compare two git branches in Visual Studio 2017? I just want to see what files have been changed on my feature branch compared to the master branch.
I'm aware that I can go to Team Explorer > Branches > Right click and View History > and then double click a specific commit to see it's changes. However, I'm not aware of a way to the sum of changes for that branch.
You can create and checkout branches directly within VS code through the Git: Create Branch and Git: Checkout to commands in the Command Palette (Ctrl+Shift+P). If you run Git: Checkout to, you will see a dropdown list containing all of the branches or tags in the current repository.
Go to Team Explorer > Branches > Right click your branch > View History > click the latest commit > ctrl + click the latest commit from master > right click > Compare Commits
edit: this only shows you the diff between commits. There's still no way that I'm aware of to compare branches via the VS interface.
However, if you want to see all the changes you made in a feature branch before submitting a PR, using command line you can do this:
checkout master
merge <branch-name> --no-commit --no-ff
and then look at Changes in Team Explorer to see all the changes you made in a branch before submitting a PR.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With