Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS shortcut to compare a modified file with the latest version

Tags:

tfs

Right now I have to pull up Pending Changes window, right-click on the file and select Compare->With Latest Version... Is there a faster way to look at my modifications?

like image 316
dev.e.loper Avatar asked Nov 07 '11 14:11

dev.e.loper


2 Answers

Keyboard Shortcut for doing TFS Compare

In the Team Explorer window under Pending Changes:

  • shift + enter on file
    • will compare the files
  • shift + double click on file
    • will compare file in background
  • Create visual studio mapping for the commands:

Set the shortcut for compare folder under Source Control Explorer, you should set the shortcut keys for File.TfsFolderDiff command.

Set the shortcut for compare specific file under Source Control Explorer, you should set the shortcut keys for File.TfsCompare command

Note: To set the keyboard shortcuts, open "Tools > Options". In the dialog that opens, go to "Keyboard". Example:

Note: The folder compare shortcut is only valid from the "Source Control Explorer". It is the same as right clicking in the "Source Control Explorer" and selecting "Compare...".

How to apply keyboard shortcut

References:

  • Keyboard shortcut for File Compare?
  • Comparison keyboard shortcuts for Pending Changes in TFS by Alex Meyer-Gleaves.
  • How to Double Click to Diff Pending Changes in TFS by Richard Banks
  • TFS Shortcut to do a diff on all modified files with latest version
like image 79
Sam Avatar answered Sep 21 '22 01:09

Sam


You can switch the double-click behaviour in the pending changes window to do a compare with latest by changing a registry setting:

Path:  HKCU\Software\Microsoft\VisualStudio\<ver>\                                TeamFoundation\SourceControl\Behavior Value: DoubleClickOnChange (DWORD)  0 == view as the primary command (default)  1 == compare as primary command 

You can find more information here:

  • How to Double Click to Diff Pending Changes in TFS.

A comment on that post also shows the entry to set if you want to use a shortcut key to do the comparison instead.

like image 38
Richard Banks Avatar answered Sep 24 '22 01:09

Richard Banks