WinMerge is a great Open Source Diff tool

Posted by Dan on Nov 7, 2007 @ 8:59 AM

In the past I've blogged about some free Windows-based Diff tools—like ExamDiff. However I recently came across WinMerge—an "Open Source visual text file differencing and merging tool for Win32 platforms."

I've only been playing around with it for a couple of days, but I'm very impressed so far. It does a very good job visualizing the differences in files and has a lot of configuration options (such as how to interpret whitespace.) You create patch files, merge the changes together and even compare folder contents.

The feature I really like is Windows Explorer Context Menu integration. The context menu allows you to select two files in Windows Explorer and right-click and select the "Compare" option and instantly get a diff from those two files. There's also an option called "Compare To" which allows you to select a single file and then you can explore to another folder highlight a second file and select the "Compare" option to compare those two files. I really like this option. For me this is generally much more convienent than open the program and using an "Open" dialog to compare two files. I just find when I need to compare two files and I'm not already in Eclipse, then I'm probably looking at the files in Explorer—so the context menu integration is extremely convienent.

NOTE:

I choose to install WinMerge by downloading just the archived version of the file.

I always prefer using non-installers whenever possible, because then I have complete control of what's going on. It's also really easy to remove the program if I don't like it.

However, if you choose to use this method, you need to manually register the Shell Integeration DLLs. This is done by just running the "register.bat" file in the WinMerge directory. There's also a an unregister.bat file for unregistering the DLLs.

After registering the DLLs, you then can enable the context menu integration from the Edit > Options > System menu by selecting the options you want in the Integration field group.

This is definitely one Diff tool worth downloading and evaluating.

Categories: JavaScript, SQL, HTML/ColdFusion, Flex/Flash, Java

11 Comments

  • I like Beyond Compare. Haven't used any others, so don't know how it, er, compares...
  • I've been a happy WinMerge user for 3 or 4 years now. A couple of cool value-adds:

    1. If you use Svn/TortoiseSVN, you can make WinMerge (or any other,for that matter) your default diff tool for use with SVN Diff.
    2. There's an Eclipse plugin that allows you to use WinMerge in place of Eclipse's built-in compare utility.

    I've never heard of Beyond Compare, but WinMerge has never let me down. I've never had a reason to look anywhere else, but I might have to take a look...
  • WinMerge is a great tool - to piggyback on Rob's comment...it plugs into VSS if you're stuck working with that...like me :-(
  • If you're, um, lucky enough to use StarTeam, you can integrate WinMerge into it to be the compare and merge tools. If find it MUCH easier to understand and use than StarTeam's default tool.

    In StarTeam 2006 (older versions are similar):
    Tools->Personal Options->File Tab->Alternate Applications
    Check Merge Utility, set the path to WinMerge, such as: C:\Program Files (x86)\WinMerge\WinMergeU.exe
    Set the options to: $BRANCHTIP $USERTIP $RESULTFILE
    Same for Comparison Utility, except set the options to: $FILE1 $FILE2

    And for Linux (KDE) users, there is KDiff3, which can be integrated into StarTeam is a similar way.
  • Plus don't forget the keyboard shortcuts that make it even faster to do a merge:
    Alt+up/down - next/previous difference
    Ctrl+left/right - choose left/right difference (or move text left/right, however you like to think about it)
  • Make that Ctrl+Alt+left/right to move code. I press that key combo so much, it's just muscle memory.
  • Winmerge is great and nice software. But sometimes, it does not detect some part of miles which are matching. There, beyond compare works a little better but KDiff3, an open source software works great too. So I usually use winmerge for its useability & look, and KDiff3 when winmerge does not handle the files properly
  • "come part of files" sorry for the typo
  • I like CSDiff. It also shell integration. You can choose two files and "send" them to CSDiff via the send To menu. It can also by word, which I find better than per line.
    http://www.componentsoftware.com/Products/CSDiff/i...
  • Yes, WinMerge is a great free tool. I've been using it since about 2003. I'd like to see it ported to Linux.
  • nice discussion here, just to add my 2 cents....I use Beyond Compare and its really nice as well...does he job well.

Comments for this entry have been disabled.