KDiff3 is an open source file comparison and merge tool
KDiff3 is an open source file comparison and merge tool that's available for Windows and Linux. It's a KDE project.
Unlike some comparison tools, KDiff3 is capable of three-way comparisons, i.e., you may use it to select up to 3 files or folders for comparison or merging.
Run the program and you'll see a pop-up window overlapping the interface. Select the files or folders to be processed. Let's try it with a couple of documents. The application loads one document in each pane. The differences in the content are highlighted on a color-coded basis.
The interface of KDiff3 is made up of a menu bar and a toolbar. The File and Edit menu are for performing basic operations like opening, saving, copy, paste, cut, etc. The address bar at the top of each pane shows the name and the full path of the loaded file. There is a status bar below it that displays the current line number, the encoding format and line end style of the document.
Use the Diffview menu for additional options such as Word Wrap, Diff Windows, add or clear manual alignment, toggle the line numbers, space and tabulator characters, whitespace. Jump to the next conflict, i.e., difference in the content, by using the movement menu.
When the documents contain whitespace at the same lines, a conflict occurs, and you'll have to use the Merge menu to decide which content should be saved in the output document. And since this is a new file, it does not affect the ones which are being merged. You can also right-click on a conflict to view a context menu that allows you to choose which line to use, the one from Document A or B.
This is a fantastic way to observe the changes made between two or three revisions of a document, without manually having to go over it.
Folder Comparison and Operations
KDiff3 can also be used to compare folders and if required, merge them. Comparing 2 folders displays a summary that tells you the total number of files in the directories, how many of those are the same, and the number of different files. Click ok to view the actions that you can choose. Once again it is presented in a color-coded form, and you can see which files exist in Folder A, the ones in Folder B, and the common ones.
The Folder Menu is activated when you select two directories for comparison. This allows you to merge the folders or specific files. You can also compare selected files. The results can be toggled to show identical files, different files, only those in A or B.
For quick operations, you can use the menu item that lets you select all files in a folder. Once you have selected some files for merging or synchronization. Select the Current Item Merge or Current Sync Operation and pick the folder to be used as the source. You can optionally select the "Delete (if exists)" or Do Nothing option to delete or retain the files in the destination folder.
When you're ready, hit F7 or the Start/Continue Folder Merge option to apply the changes. You'll be given an option to simulate the result, which displays a log of the changes that will take place if you actually proceed with the operation. In this example, IÂ have opted to select folder A as the source. So the contents will be copied to folder B.
KDiff3's Options screen can be accessed from the settings menu. It lets you customize the font type, size, colors used for the difference indicators. There are some advanced options that you can define for the merge, folder settings.
Installers for the Windows version of KDiff3 are available at the Binary Factory page. The program is is also available for Linux from the KDE website. There is an older version on SourceForge that is missing some features.
If this isn't your cup of tea, Meld is a good alternative, that's also open source and cross platform.
Sorry- I totally missed the .exe file… thanks for the tip
I would appreciate any pointers on how to convert these binary(?) files into window executables. I assume these are compiled for Linux which I am unfamiliar with. There must be an app somewhere but I don’t know where to start. Thanks
As Ashwin mentioned in the article, installers for Windows are found here: https://binary-factory.kde.org/view/Windows%2064-bit/job/KDiff3_Nightly_win64/
[b] kdiff3-master-21-windows-msvc2017_64-cl-dbg.7z
[a] kdiff3-master-21-windows-msvc2017_64-cl-dbg.7z.sha256
kdiff3-master-21-windows-msvc2017_64-cl.7z
kdiff3-master-21-windows-msvc2017_64-cl.7z.sha256
[c] kdiff3-master-21-windows-msvc2017_64-cl.exe . . . . . 50MB
kdiff3-master-21-windows-msvc2017_64-cl.exe.sha256
Which one is for Windows ?
[a] is not for Windows , Virus Total returns a blank report
[b] when extracted it has 119 EXE files, none that resemble a primary EXE
[c] Virus total returns a risk score of 1/67 but the VT report is empty. No AVs list
I started to install [c] but got feet …
Not for the feint hearted.
Number c is the right one that you can install.
ie, cold feet
Meld is much more convenient
I’ve used KDiff3 on Windows for years, since for a long time it came bundled with GitExtensions. I’ve had weird issues with it on Mint lately, so I’ve started using meld there instead. Still an excellent diff tool nonetheless.
forgot to ask: can it produce patch files made from the diff?
binary files arent supported i guess?
edit: yes, homepage says so. (maybe add that important piece of info above?)
How about WinMerge?
This looks like a great program that I would like to try. Clicking on the link in the summary box at the end of the post brings me to a page with an “Install” button, but clicking it brings up an empty page saying “The address wasn’t understood”. I am using Firefox, how can I download and install this program?
The KDE link on the page is only for Linux distributions. The Windows version is a little old, but still works quite well and can be found here: http://kdiff3.sourceforge.net/
@Ashwin can perhaps make a note of this?
Thanks Ascrod. Your insturctions worked.
Buzz
If you want to see the latest version (the one on sourceforge.net is quite old), you can download the installation binary from project page kde.org:
https://binary-factory.kde.org/view/Windows%2064-bit/job/KDiff3_Nightly_win64/
Here they are building the code from the project repo every night.
I’ve been looking for this type of software for a while now, thanks Ashwin, for the heads up!
Apart from Meld any other recommendations from the populous would be appreciated too. Thanks in advance. -Z-