views:

20092

answers:

47
+189  Q: 

Best Diff Tool?

For all my present Diff / Merge needs I'm using [Beyond Compare][1]; when I decided to buy a license for it I tried other similar tools, both payware and freeware.

Now BC is at version 3, and I think it's a great tool... but what are your experience in this field? Do you think there is something better? And what are the feature you like best on your favorite Diff tool?

EDIT

I'm recollecting here a list of the tools mentioned in the answers below, in order of preferences (more or less), separating pay- from free- ware and indicating supported operating system. Hope this helps.

PAYWARE

FREEWARE

+29  A: 

Diff Merge from SourceGear is free and good: http://www.sourcegear.com/diffmerge/index.html

dpp
I've been using this lately, and it seems to behave incorrectly during merges - it looks like it always gives preference to my version of the file, so other people's edits are lost (if I don't manually catch them, that is).
Johan
No line wrapping, so it fails on any kind of tex editing.
mmr
+6  A: 

We use Perforce for source control at work, and now Perforce have released their merge tool as a free stand alone merge tool. I think it's pretty good, plus, it integrates well with Perforce server.

http://www.perforce.com/perforce/products/merge.html

urini
+80  A: 

I'm partial to WinMerge, which does everything I need. I've never used Beyond Compare so I can't speak to the difference in features between the two.

Adam Lassek
WinMerge is a nice diff tool, but it doesn't handle 3-way merges like many of the other tools.
Bert Huijben
I would love to use WinMerge, but it doesn't support 3-way diffs. This makes it difficult to use with modern version control software like Subversion.
Trumpi
WinMerge works well. Even when I had a licensed copy of Beyond Compare on my machine I set everything to WinMerge.
280Z28
I've used WinMerge, but still prefer BeyondCompare. In simple file to file comparison the two are very similar, but I still prefer the BeyondCompare interface.
smencer
+2  A: 

I've had good luck with ExamDiff; it's free and does what I need it to do.

Bruce Alderman
+110  A: 

I have used a few others and found that Beyond Compare is quite good. I say stick with that.

Terrapin
I'll actually copy source directories from my Linux machines to Windows just so I can use Beyond Compare on them. It's too bad there are no free alternatives that are as good, but BC is easily worth its price.
Kristopher Johnson
Beyond Compare 3.0, supports Linuxhttp://www.scootersoftware.com/download.php?zz=kb_linux
stukelly
I'm tried a few, installed KDiff3 and Beyond Compare 3. After a few weeks I paid for 3 Beyond Compare 3 licenses, enough for our small team. You will not regret spending that $50.
Brian Boatright
Go with Beyond Compare. It is a lot better than all others I've tried.
Kristof Neirynck
Agreed. Beyond Compare may not be free, but it's not all that expensive either, and in terms of quality, there's just nothing else that *ahem* compares with it.
Mason Wheeler
I've compared quite a few, but nothing compares to Beyond Compare.
abrereton
I just installed Beyond Compare and it's really slick!
Joe Philllips
+19  A: 

I use meld.

sudo apt-get install meld
David Locke
Meld (linux only) has a very nice graphical file compare. Check the website: http://meld.sourceforge.net/
Bob Fanger
IMO, really the best OpenSource tool.
e-satis
+35  A: 

I second the WinMerge recommendation, it handles file/folder diffing and merging greatly. There are handy filters built in as well to block out source control files and stuff like that. Plus it's free! Here's the list of features from the site:

  • Visual differencing and merging of text files
  • Flexible editor with syntax highlighting, line numbers and word-wrap
  • Handles DOS, UNIX and MAC text file formats
  • Unicode support
  • Difference pane shows current difference in two vertical panes
  • Location pane shows map of files compared
  • Highlights differences inside lines in file compare
  • Regular Expression based file filters in directory compare allow excluding and including items
  • Moved lines detection in file compare
  • Creates patch files
  • Resolve conflict files
  • Shell Integration (supports 64-bit Windows versions), including an option to easily select two items (if enabled in its settings)
  • Rudimentary Visual SourceSafe and Rational ClearCase integration
  • Archive file support using 7-Zip
  • Plugin support
  • Localizable interface
  • Online manual and installed HTML Help manual
travis
A: 

I use winmerge. One thing I /would/ like to see in it would be the ability to force a match (this line on the left is that line on the right)

BCS
Beyond Compare does this.
fatcat1111
+1  A: 

I use the Compare plugin for Notepad++; its built right into your editor. While it doesn't compare directories or anything "advanced," it does a great job at file-to-file comparison. And it's free.

Jeff Winkworth
+21  A: 

Vimdiff.

It's part of the vim distribution. Interactive, syntax-highlighting diff with the full text editing power of vim. It uses folding ("zc" to close a fold, "zo" to open one) to hide matching parts.

nsanders
Agreed. And, since it's really part of (g)vim, you can diff any two buffers you happen to have open in an existing vim session by executing 'diffthis' in each one. Handy.
overthink
I would say "the best", but definitly a must know since it's priceless on the command line.
e-satis
Although it's handy to have on-hand in Vim, I do find that it's one of the stupidest diff engines I've used...
Ipsquiggle
+7  A: 

I use perforce merge for single-file source merges and araxis merge for folder-to-folder compare.

I think perforce is superior for single file - I really like it's 4-way merge screen (source control branch tip, local version, common ancestor from source control and target) and it's color/shape-coding. Also, it's automatic merge (suggested target) is very smart and suitable for Java.

Araxis merge has the unique capability to compare an entire folder tree, drilling down to file-to-file compare in a click. I find this useful in version compare situations when I quickly need to assess the amount of changes or track a specific change.

Ran Biron
Araxis is really the best. You can even generate html reports of the diff. Its really amazing..
Prakash
The folder compare ability isn't unique by a long shot - both KDiff3 and SourceGear DiffMerge allows that.
Johan
+15  A: 

The best tool which I saw and used is Araxis Merge. It has a lot of useful functions, including:

  • Auto resolving of conflicts after merge.
  • Horizontal and vertical two and three-way comparison.
  • Strong edition features (move, delete, add before/after line/block, in-place editing).
Grzegorz Gierlik
+2  A: 

I like the merge that is included in Tortoise SVN

Graphain
If you like Tortoise diff, try WinMerge, it integrates with Tortoise and is even better.
Roger Nelson
funny, i can't stand the merge tool in tortoise.
Matt Briggs
+1  A: 

I'd second the recommendation of (g)vimdiff. Often its very useful to have a powerful text editor, complete with syntax highlighting while comparing (and merging) files.

For situations where a tool (e.g. CVS or git) has already run a merge and left conflicts in a file, xxdiff has a really neat mode where it can separate the file and show it in a side-by-side diff.

shmuelp
+11  A: 
Prakash
+14  A: 

I vote for KDiff3. It supports 3-way merging, which is great for working with copy-edit-merge version control systems like Subversion. It also allows editing in the results pane.

The only other diff tool I know that supports 3-way merging is diffmerge.

Winmerge does not support 3-way merging, so it is not good enough for me.

Trumpi
I agree, 3-way merge is important. KDiff3 also integrates nicely with clearcase.
hlovdal
And unlike WinMerge, KDiff outputs are actually readable.
analytik
The Professional version of Beyond Compare also supports 3-way merge so it's not just diffmerge. Ref: http://www.scootersoftware.com/moreinfo.php?zz=moreinfo_merge
John K
+23  A: 

By far, BeyondCompare is the best diff/merge tool that I have ever used.

  • We evaluated both BeyondCompare and Araxis for integration into clearcase, and after extensive testing with complicated deliveries BeyondCompare came out on top because of its solid handling of complex automatic merges. It happens to be much cheaper as well.
  • I use the Explorer context menu integration all the time on Windows (32-bit and 64-bit)
  • It runs on both Windows and Linux
  • Love the free trial period.. finally a product that is "30 days of use" instead of "30 days since I installed and forgot about it".
    • Excellent discounts if you purchase in bulk
  • Powerful directory comparisons
    • Compare a directory to a .zip file
    • Compare a directory to an FTP site
  • 3-way Merge, inline editing, syntax highlighting
  • compare images, Source Code, binary files, mp3 metadata, ...
  • can save "sessions".. for instance: compare changes in the last 60 days in "My Documents" to an folder on an external hard drive
  • Good source control integration
    • When you diff with a directory that's configured under source control, it will prompt you to automatically check out the files you're trying to overwrite!
    • Can be configured to handle the silent merges for clearcase (probabaly other tools too)
  • Supports input/output filters, for instance XMLTidy/HTMLTidy
Andy Stevenson
I have used WinMerge a lot and Beyond Compare a little bit. Some features in WinMerge that I miss (perhaps just have not found) in Beyond Compare are:* moved block detection (that some text has just moved, not displayed as deleted and added)* WinMerge has better syntax highlighting (for C# at least)But I like the "ignore unimportant differences" option in Beyond Compare
Klas Mellbourn
A: 

Another vote for Araxis Merge. The Standard Edition has covered 95% of the diff/merge tasks that I've encountered. It is good enough that I purchased a personal copy for work.

+3  A: 

I've tried a bunch of the other diff tools out there and I still keep coming back to Beyond Compare. I haven't tried v3 of Beyond Compare yet though...

Ausmith1
A: 

I think it depends on what your trying to compare and why. I use WinMerge most of the time. Sometimes I use DiffMerge. Sometimes I use Tiny Hexer.

+4  A: 

ediff - bundled with Emacs

It handles pair-wise diffing, file merging, directory diffing/merging. It can apply mutli-file patches, and it groks version control. Plus, you get all the features of Emacs: .zip/.gz/.tar support, syntax highlighting, ftp/ssh support, unicode, etc. etc.

Trey Jackson
+3  A: 

Would agree with the top 3:

  • Beyond Compare (if you have money to spend)

Otherwise:

  • WinMerge (free)

  • Diff Merge from SourceGear (free)

Mitch Wheat
A: 

After trying a couple other diff programs for Windows, I stuck with Araxis Merge. The standard version does about everything I'd want done with 2-way diffing. Also, the immediate impression it makes is very good; it doesn't overwhelm you with colored lines. In other words, it tells you what you need to know without confusion. It is also supported very well.

scottb2
+1  A: 

Even if I did not try these, I'm adding for completeness also:

ila
+2  A: 

Beyond Compare for Windows is a must - in Mac land there aren't many to choose from (which is a pitty) Changes isn't too bad, but pales in comparison to a full featured tool like Beyond Compare.

d2kagw
I find Deltawalker for Mac (also runs on Windows/Linux) to a fairly good BC replacement.
Lars Tackmann
+6  A: 

I think Kompare has the best interface of any diff tool I have even seen, I just wish I could find something like it in Windows.

http://www.caffeinated.me.uk/kompare/

Miquella
+1  A: 

On Mac OS X you have Apples FileMerge which comes with the Developer Tools.

naltatis
+1  A: 

A couple more for the list.

Changes for OSX as payware (http://www.changesapp.com)

tkdiff is free under the GPL (http://tkdiff.sourceforge.net)

Michael McCarty
A: 
  1. Winmerge
  2. notepad++ merge plugin (usually use this as a quick way if I do have both files open but for serious merging I'll go to no. 1)

I don't know Beyond Compare or Araxis thus can't comment on them.

Schalk Versteeg
A: 

Another vote from me for WinMerge. I've been using this tool for some years now and with a recent new project I discovered just another nice feature:

The installer integrates nicely with a local clearcase client installation.

mkoeller
A: 

WinMerge and eDiff; I use WinMerge when I'm comparing entire folders, but eDiff for 2 or 3 files, or snippet comparison.

Michael Paulukonis
+2  A: 

Diffuse (http://diffuse.sourceforge.net/) is good cross-platform diff/merge tool. It's features include:

  • ability to compare and merge an arbitrary number of files side-by-side (n-way merges)
  • line matching can be manually corrected by the user
  • ability to directly edit files
  • syntax highlighting
  • Bazaar, CVS, Darcs, Git, Mercurial, Monotone, Subversion, and SVK support
  • support for UTF-8 encoded unicode
  • unlimited undo
  • easy keyboard navigation
A: 

I like SmartSynchronize. It is effectively the built-in compare/merge tool for SmartCVS (and I assume SmartSVN), but separated out for use on the file system. Written in Java, so runs on most Java-supporting platforms.

Scott W
+1  A: 

I really like the free and excellent Perforce Merge tool (also known as p4merge).

Dan Esparza
+1  A: 

Beyond compare is an excellent tool. The only downside is it is payware. Wikipedia has a great chart comparing all the features amongst the various programs even some not listed in the question. link text

DJ
I use Beyond Compare for some time now and it was the best diff tool I've ever used!
Vargas
A: 

SourceGear's Diffmerge also has folder diffing. Using the tool with Mercurial :-)

+2  A: 

Most diff tools report just text differences at the line level.

A tool that compares source code structures, regardless of whitespace formatting (including line breaks) and reports reports changes in terms of structures inserted, deleted, moved, replaced, or changed by consistent identifier renaming gives better information to the programmer.

Our Smart Differencer does this for many languages, including Java, C#, Javascript and COBOL.

EDIT Feb 2010: Now does C++, PHP and XML

EDIT Aug 2010: Now does Python, EGL and Natural

Ira Baxter
+7  A: 

Beyond Compare? That's so 80's...

Check out, history flow, now you're talking diff, over an infinite set of changes.
alt text alt text

It's the closet thing that you can get (yes free code available) that even BEGINS to be in the same ballpark as the visualization guru, Ben Fry, had developed the revisionist:

alt text

While it's obvious that the code in a software project changes over time, less obvious is the nature of how the code how individual changes have taken place in a broader context. Projects are typically structured as a collection of files that are added, removed, and reorganized throughout the course of development. The contents of the individual files are modified, line by line or in large pieces for every fix and feature.

the Revisionist, de facto, more than beyond comparison, it's beyond reproach.

RandomNickName42
This tool is different. Thank you for the contribution!
John
How would either system deal with representing distributed version control?
mavnn
A: 

WinMerge is out because it doesn't do side-by-side comparisons of FOLDERS/FOLDER TREES.

I currently use BC2.x & love it.

Also, it is licensed for use BY ME on unlimited PCs, and can be configured as a PORTABLE APP.

I never heard of Araxis, but it looks good, and it does 3-way merges (BC2 doesn't, I don't know if BC3 does). But Araxis is MUCH more expensive, and is licensed per computer (thus I doubt it can be configured to be portable).

A: 

checked website.

BC3 does do 3-way mergers, if you buy the pro version ($20 more)

+1  A: 

I personally use Delta Walker. It is available on Windows/OS X/Linux, works as good as Araxis, but is much cheaper.

KIV
+1  A: 
romaintaz
+1  A: 

please try Compare++. The diff tool is a visual specialized tool for source code file comparison, merging and folder synchronization.

What you can do with Compare++

  • Compare sub-sections of files such as code structures;
  • Compare files and folders with lightning speed;
  • List all code structures change such as function changes
  • One step to merge multiple differences from side to side
  • Compare the containing folder for loaded files
  • Support "Edit files and instantly compare"
  • Automatically detect files and folders changes outside

alt Compare file alt Compare folder

+3  A: 

I use CodeCompare (http://www.devart.com/codecompare/) for C# code comparing. It is very useful - product is integrated to the Visual Studio and I can make changes with the help of the Visual Studio editor.

JackD
A: 

what about good old 'diff' command? Is good writing diff scripts.

graveDust
For small changes it's good. However, it's often nice to be able to edit the files from the diff view, and also visual tools are good for giving more context (e.g. during a code review when you want to talk around the change).
danio
+1  A: 

Take a look at the Xdiff in Plastic. Together with the typical diff stuff, it can also track moved code fragments even when they've been modified after the move (some sort of refactor-aware diff tool)

pablo
Looks nice but they have secret product pricing.
danio
A: 

I really like the diff tool in IntelliJ IDEA. Wish they had a standalone version as well.

rlovtang