Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Diff between commits in Visual Studio 2015 using git

Tags:

Using Visual Studio 2015 Update 2 and git as source control, how do you diff between 2 commits on a branch? Note that I am not talking about diff on the granular file level (ie. view history of file and comparing), but rather for entire commits.

I would expect to be able to compare when looking at the history of a branch, but the option does not exist. Here's the right click menu I see when I right click on a commit when viewing the history of a branch:

enter image description here

Where's the compare??

like image 956
bitbyte Avatar asked Jun 14 '16 17:06

bitbyte


People also ask

How do I compare commits in Visual Studio?

Compare commits To compare any two commits in your branch, use the Ctrl key to select the two commits that you want to compare. Then right-click one of them and select Compare Commits.

How do I find the difference between two commits in git?

To see the changes between two commits, you can use git diff ID1.. ID2 , where ID1 and ID2 identify the two commits you're interested in, and the connector .. is a pair of dots. For example, git diff abc123.. def456 shows the differences between the commits abc123 and def456 , while git diff HEAD~1..

What is the difference between two commits in github?

You can also compare two arbitrary commits in your repository or its forks on GitHub in a two-dot diff comparison. To quickly compare two commits or Git Object IDs (OIDs) directly with each other in a two-dot diff comparison on GitHub, edit the URL of your repository's "Comparing changes" page.

Which command shows the difference between commits?

git diff is a multi-use Git command that when executed runs a diff function on Git data sources. These data sources can be commits, branches, files and more.


1 Answers

While not possible in Visual Studio 2015, this functionality will be included in Visual Studio 2017.

In Visual Studio 2017 it will be possible to get the changes between two different commits. This functionality can be accessed via selecting two commits on the history page and choosing the "Compare Commits..." command:

Compare Commits entry point

This functionality is present in the preview releases of Visual Studio 2017, so you can try it out and see if it is what you are looking for.

like image 172
jamill Avatar answered Sep 22 '22 07:09

jamill