How to force Visual Studio compare to 'Latest Version' instead of 'Workspace Version'

55 views Asked by At

When I right-click a file in Source Control Explorer (which shows 'Latest' of 'No'), and choose 'Compare...', the dialog always defaults to Source Version: Type: 'Workspace Version'. I never ever want to compare to the Workspace version. I always want to compare to latest version.

I change this bad default at least a dozen times per day. How can I force VS to default to "latest" instead of "Workspace"? enter image description here

1

There are 1 answers

1
jessehouwing On

There is no built-in way to fix this as far as I know, but you can call the diff from the commandline, so you can configure it as a "tool" in visual studio. Using the commandline you can set your own desired commandline flags:

tf folderdiff [sourcePath] targetPath [/recursive] [/noprompt] [/collection:TeamProjectCollectionUrl]
[/filter:filter] [/filterLocalPathsOnly] [/login:username,[password]] 
[/view:same,different,sourceOnly,targetOnly]

In Visual Studio you can configure "External Tools" to then invoke the commandline you want. If needed wrap the CLI call in a batch script that asks for the desired prompts.