简体   繁体   中英

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 :

承诺历史TFVC

文件在2次提交之间更改

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

提交历史git

I only can compare a commit with his parent commit :

git与父提交进行比较

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

git比较提交之间的单个文件

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.

There is not a way to compare two arbitrary commits in Visual Studio 2015. However, 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:

比较提交入口点

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM