I suggest you ...

Allow "Compare working copy to historical version" version in TFS GIT 2015

Allow "Compare working copy to historical version" version in TFS GIT 2015

http://stackoverflow.com/q/34123687/30225

When I pull up the history of the file I can compare that version with another version listed in the history by selecting both and doing a "Compare", or I can compare a historical version and its changes wrt to its previous version by selecting "Compare to Previous".
However, there isn’t a command that will let me compare a historical version in the history list to the currently edited version on disk.
This was one of the best features of TFSVC and I would be good to bring it back for the GIT support in VS 2015

163 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Preet Sangha shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    10 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Marc Dixon commented  ·   ·  Flag as inappropriate

        This is a little more cumbersome but will achieve what you want.

        Set Visual Studios diff tool to be the default diff tool.
        Go to Team Explorer > Settings > Git > Global Settings. Then for either difftool or mergetool or both click Use Visual Studio.

        Next, go to the Branches list.
        Right click on the branch and select "View History".
        Make note of the ID of the commit that you want to compare against.

        Right click on the repository and select "Open Command Prompt".

        type git difftool <commit>

        Where <commit> is the ID that you recorded from the previous step.

        You can now choose which file from the previous commit that you want to compare against in your current code using the Visual Studio diff tool.

        You can also make changes in the difftool to your current code.

      • Matt Halstead commented  ·   ·  Flag as inappropriate

        I'm just starting to experiment with VS2017's Git functionality, and it seems like a glaring omission that I cannot diff a commit against the current head using the View History tab; I did not expect the TFS workflow to be more productive when diffing changes, but it is.

        Today I was working through the scenario of selectively removing parts of a previous buggy commit. It was really easy to diff any two commits, but impossible to change the code in that diff view. I ended up extracting git archives for the good and bad commits, and then merging them into the working folder using an external tool. So tedious.

        I really think its vital to provide diff vs head, allowing editing in place and saving to the working folder.

      • Travis Terrell commented  ·   ·  Flag as inappropriate

        I was about to suggest this for VS2017. However, since I found this previous suggestion, I just provided a vote for it. Visual studio's comparison tool works really well, I really dislike having to use an external diff tool to accomplish this basic task.

      • Andrew commented  ·   ·  Flag as inappropriate

        Should be able to compare any version to any version. This should always be built in. People don't always remember everything they did at check in, and if something breaks finding the problem can be painful without this feature.

      • David commented  ·   ·  Flag as inappropriate

        Not only would I like to see a "compare with current" option, I would also like to edit the current version in the comparison window and reflect individual differences from the historical version into the current version.
        For example, say there was a particular method in a class that was changed a few commits ago (along with other changes in the same file) and I decide that the method needs to be reverted back to the way it was before. I find the commit just before the change was made and compare this file from that commit to current version, move down to the method in question, then remove the difference by reflecting the old version of the method into the current version.

      • Eric Bl commented  ·   ·  Flag as inappropriate

        IMHO, "compare with current" would be much more useful than "compare to previous"

      • seanv commented  ·   ·  Flag as inappropriate

        On VS2015 Update 1, (maybe earlier):
        Right-click a file and choose "View History".
        Click one version (commit) and <ctrl>-click another version (commit).
        Right click one of the selected items and choose "Compare...".
        Whoever designed the right-click menu for this part doesn't know what the "..." is for, so it is confusing. (The known "Compare with Previous..." also shouldn't have "...") But it does work.
        I'm using GIT as the SC. I also have "git version 2.6.2.windows.1" installed.

      • S Olson commented  ·   ·  Flag as inappropriate

        Please add this. It is always embarrassing when my colleges ask how to compare to current. It comes up quite a lot.

      Feedback and Knowledge Base