visual-studio without tfs - Compare two files in Visual Studio
I saw new comparsion tool in VS 2012 for comparing two files or two versions of file. I like it. But when I tried to find it I can't because I don't use TFS. Is there a way how can I just compare two files with builtin feature in VS but without TFS?
I have always been a fan of WinMerge which is an open source project. You can plug it into Visual Studio fairly easily.
will show you how to do this
Command Window (CTRL+ALT+A)
Tools.DiffFiles File1 File2
File Comparer VS Extension by Akhil Mittal. Excellent lightweight tool that gets the job done.
To compare any two files and merge it to one file Here are the following steps you can follow if you have visual studio(Any version) installed.
Step 1: Open Visual studio command prompt. If you do not find visual studio command prompt then choose visual studio tools
Start -> Visual studio command prompt
Step 2: Enter the command vsdiffmerge.exe
Ignore the switch /m if you need just comparison.
vsdiffmerge <file1> <file2> <file1> <outputfile> /t /m
vsdiffmerge <basefilename> <CompareFilename> <basefilename> <OutputFilename> /t /m
vsdiffmerge test1.js test2.js test1.js output.js /t /m
vsdiffmerge.exe "C:\Users\livingston\Downloads\wa\wa\Files\pre\Test.js" "C:\Users\livingston\Downloads\wa\wa\Files\Prod\Test.js" "C:\Users\livingston\Downloads\wa\wa\Files\pre\Test.js" "C:\Users\livingston\Downloads\wa\wa\Files\output\samp.js" /t /m
Step 3: Merge the files
Also you can beautify the file before you do the comparison. In visual studio Ctrl + K + D.
There are lot of beautifier sites available online.
The problem is that you can't compare files in diferent proyects, but you can copy the files in the same project to compare...
If you are working with TFS connected then right click on file which you need to compare (through source control explorer) and it presents you a window like this -
Now change path of source file in 'Souce Path:' and you get comparision through VS comparision tool.
Similarly you can compare folder also which compares all files of a folder at once.