3

In Visual Studio lets assume the following scenario:

  1. Create a branch from the master.
  2. Make some changes.
  3. Commit.
  4. Again make some changes.
  5. Commit.

When we make a commit there are no changes displayed under the Team Explorer > Changes. If we didn't do the step 5 the Changes tab will display the current changes compared with the previous commit. I need to know how to compare current state of the branch(committed + uncommitted) with the original code(master branch).

harinsamaranayake
  • 473
  • 1
  • 8
  • 23
  • Do you mean as in https://stackoverflow.com/a/57833947/6309? – VonC Sep 25 '20 at 05:55
  • Does this answer your question? [How to compare different branches in Visual Studio Code](https://stackoverflow.com/questions/42112526/how-to-compare-different-branches-in-visual-studio-code) – dan Apr 21 '21 at 05:53
  • 1
    The links provided are helpful for Visual Studio Code but not for Visual Studio 2019 – J.J Sep 23 '21 at 16:04

2 Answers2

2

If you are using the Microsoft DevOps as your remote repository. DevOps has a way to compare branches. Under the "Repos/Branches" menus.

Example Heading:

Branch compare Comparing "RevampTasks" to "Development"

cc sdk
  • 21
  • 2
0

For Visual Studio 2019 (as asked)

  • Open window Git Changes
  • Click on Additional Operations

Git Changes Window

  • Click Manage Branches

enter image description here

  • Select the two commits/branches you want to compare (with ctrl+click)

enter image description here

  • Right click on one of the selected commits and choose Compare Commits

enter image description here

  • Now at the bottom right you should have a list of the files that have been changed and you can click on them to see the differences between them.

enter image description here

J.J
  • 701
  • 13
  • 27