Differences between git branches using Visual Studio Differences between git branches using Visual Studio git git

Differences between git branches using Visual Studio


To compare a specific object (solution, project, source file,...) in Microsoft Visual Studio (using MVS2015):

  1. Locate the object in the Solution Explorer, and bring up the context menu (right-click): select "View History...". This brings up the History window for this object, with all the commits where the object changed (from any branch).
  2. Multi-select the two commits that you want to compare (left-click on the first one, Ctrl-left-click on the second one).
  3. Now bring up the context menu on either of the selected commits (right_click): select "Compare...". This brings up the Diff window for the object in the respective commits (with the differences highlighted in red -lines removed from first commit- or green -lines added in second commit). You can use the scroll bar in the Diff window, or the "Previous Difference" and "Next Difference" button in the ribbon to go between the differences of the object.

I am not sure that there is a way to compare ALL the items in two different commits (I just invoke GitKraken -free for non-commercial purposes- or any other GUI for git on my local repo). Gitkraken is amazingly simple though: select any two commits, and all the differences between those commits are available at your fingertips.


I just spent a bit of time playing with the current version of VSTS and figured it out (as of October 2016):

  1. Go to Code -> Branches
  2. Click on the commit diff count to the right of the updated date as in this screenshot:vsts_screenshot

This will take you to a page that shows both a commit difference between the two, and a file comparison


As of October 2017, when you right click on a branch under Code->Branches, you will get this menu. Click on compare branches.

enter image description here