Search code examples
gittfsvisual-studio-2015tfs-2015

TFS / Visual Studio 2015 : how to compare file changes between 2 commits


We're currently testing git as source control for our new projects. We're using TFVC for many years and we're used to the way it works. So far, pretty much everything works as expected but there's something really simple I cannot figure out : in TFVC, it's really easy to get the list of files changed between 2 not consecutive commits :

Commit history TFVC

Files changed between 2 commits

But I found no way to do this with a git repository in VS2015 or with the web interface of TFS2015 update 2 :

Commit history git

I only can compare a commit with his parent commit :

git compare to parent commit

I also found a way to compare an individual file between 2 commits but not the whole repository :

git compare individual file between commits

Is it just me not looking at the right place and if not, why such a basic feature is not implemented ? It's the kind of operation we use daily for review or bug hunting.

I know there's other ways with external tools (GUI and command line) to achieve that but I would want to stay is VS/TFS as much as possible to reduce friction for everybody in the team.

Thanks.


Solution

  • The reason for this is that git is designed around many different branches and combining them back into coherent code, while tfvc is designed around having a coherent history of modifications. If you develop a project with enough collaborators using git, you will have a branch that starts at one commit on the main branch, and, while it is being developed, more commits are made on the main branch. That branch's last commit can be modified to fit the code on the main branch, or the branch can be modified starting at its first commit to look like it was branched off the latest commit in the main branch. The second scenario is called rebasing, and it's what makes it hard to have a coherent history of modifications in git.