15
votes

In Visual Studio 2012, in the Solution Explorer (not Pending Changes), is there any way to create a keyboard shortcut, right click context menu item, or menu bar button that does a TFS Compare to Latest Version?

Alternatively, on the general Compare dialog, is there any way to change the default selection of Type: Workspace Version to Type: Latest Version?

Basically I am looking for the easiest way to get to Compare to Latest using the fewest clicks, from the Solution Explorer.

2

2 Answers

6
votes

Does setting a Tools/Options/Keyboard shortcut for TfsCompare help?

enter image description here

3
votes

For me, this worked:

VS > Tools > Options > Environment > Keyboard > Show Commands Containing: Team.Git.CompareWithUnmodified

By assigning a shortcut key Ctrl+\, Ctrl+\ to this command ( Team.Git.CompareWithUnmodified) I can now compare my current file (the file that is open in the editor) to the previous version of the file by pressing the shortcut key Ctrl+\, Ctrl+\; no need to find the file in solution explorer, then right-click the file then select Compare.

(you can choose your own shortcut key of course)

Just a note on different behaviour:

  • Team.Git.CompareWithUnmodified works for me because I am using TeamExplorer in VisualStudio but I use GIT as the underlying source code repository.

  • Tfs.FileCompare could also work in other scenarios (i.e. if you don't use Git, but use VSTS or TFS as your source control provider).