Diff between commits in Visual Studio 2015 using git

后端 未结 3 811
醉酒成梦
醉酒成梦 2021-01-07 18:20

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 fil

3条回答
  •  花落未央
    2021-01-07 18:54

    In Visual Studio 2015, to get a diff with two non-consecutive commits:

    • Make sure the two commits are on different branches
    • Checkout the earlier commit, then right-click on it in Team Explorer and choose "Merge From"
    • Select the later commit to merge from. Make sure the "Commit changes after merging" checkbox is NOT checked then click on Merge
    • All changes will be shown between the two commits in the "Changes" view of Team Explorer. You can Abort the Merge after you're done with the diff if you wish

提交回复
热议问题