When using git for source control in VS2013, is there any way to show a diff between two arbitrary versions of a source file in the integrated editor (either with built in functionality or a free extension/plugin)?
So far I only found out how to display the changes made since the last commit or from one commit to the next.
If it makes any difference: I'm using VS mostly for c++.
While this can be done by comparing two revisions selected in the history window for the file I would recommend the free CodeLineage extension, which include a slider that makes selecting revisions to compare dynamic and really easy. Instead of having to go back to the history window to select another pair to compare, just change the slider to the revisions you are interested in.
It's available in the online Visual Studio Gallery in Extensions and Updates inside VS too.
Sample image showing the slider to change revision at the top of the window and revision time, user and id in each window.
You can do the following:
Right click on the file and choose "View History"
On the history tab choose the two revisions you'd like to compare
Finally click on one of the selected revisions and choose "Compare..."
Also useful perhaps is the ability to compare the file you are currently editing with the most recent committed version. Right click on the file and selecting "Compare with unmodified..." seems to do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With