Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compare current file to historical version in VS2015 TFS Git Source Control

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 it's changes wrt to it's previous version by selecting "Compare to Previous".

However I cannot find a command that will let me compare a historical version in the history list to the currently edited version on disk. Does anyone know what this command is called so I can hook it into the context menu please?

This was one of the best features of TFSVC and I'm hoping it's somewhere deep in the bowels of the GIT support in VS2015.

Edit: since there is no official solution: I've created a User Voice item as suggested by @Patrick-MSFT

Allow "Compare working copy to historical version" version in git -- VS Developer Community

like image 591
Preet Sangha Avatar asked Dec 06 '15 22:12

Preet Sangha


People also ask

How do I compare files in Visual Studio?

locate the required file in the Solution Explorer window, right-click it and choose Compare Selected File in the context menu; open the required file in Visual Studio, right-click the required document name in the document tab well and in the document's context menu select Compare Current File.

How do I view the history of a file in Visual Studio?

To retrieve a previous version of a file that exists in your Visual Studio project: Right-click the file in Solution Explorer and select View History. The Visual Studio History view will appear, showing the commits in your repo that updated the file.

How do I search for a file in Source Control Explorer?

Right-Click In the File List, right-click the file you want to check in and select Source Control > Check In (for selected files) or Source Control > Project > Check In All (for all files in the project). Local Toolbar In the File List, select the file(s) you want to check in.


2 Answers

This is not supported now.

You can vote for this feature request here:

Allow "Compare working copy to historical version" version in git

In Vs, you can only compare your currently edited version with the unmodified status.

Solution Explorer File Context Menu Showing "Compare with Unmodified..."

like image 102
PatrickLu-MSFT Avatar answered Oct 22 '22 15:10

PatrickLu-MSFT


Still no support in VS2019! :(

Use Notepad++ and the Compare plugin. Open file versions of interest, select first version as set "first version to compare", then select second version and "compare". There you have the diff!

You will also get changes WITHIN rows, which is far better than compare supported by VS...

like image 3
JERKER Avatar answered Oct 22 '22 14:10

JERKER