meld
Visually compare and merge files or directories
TLDR
Start meld
Compare 2 files
Compare 2 directories
Compare 3 files
Open a comparison as a new tab in a pre-existing meld instance
Compare multiple sets of files
SYNOPSIS
meld [OPTIONS] PATH1 [PATH2 [PATH3]]
PARAMETERS
--auto-merge
Automatically merge non-conflicting changes during a three-way merge, leaving only unresolved conflicts for manual intervention.
--output=FILE
Specify the output file for a three-way merge operation. The result of the merge will be written to this file.
--label=LABEL
Set a custom tab label for the comparison or merge window, useful for distinguishing multiple Meld instances.
--newtab
Open the comparison or merge in a new tab within an existing Meld window, if one is running.
--newwindow
Open the comparison or merge in a new, separate Meld window.
--diff
Force file comparison mode, expecting two file paths. Useful when ambiguity exists (e.g., when two inputs could be interpreted as directories but should be compared as files).
--merge
Force three-way merge mode, expecting three file paths (typically local, base, and remote versions). Useful for explicit merge scenarios.
--encoding=ENCODING
Specify the character encoding for the input files (e.g., UTF-8, ISO-8859-1). Meld attempts to auto-detect if not specified.
--comparison-filter=FILTER
Apply a predefined or custom text filter to the comparison, ignoring lines matching the filter pattern (e.g., whitespace changes, specific log lines).
--no-filter
Disable all active text filters for the current comparison, showing all differences.
--help
Display a help message with command-line options and exit.
--version
Show program's version number and exit.
DESCRIPTION
Meld is a powerful graphical diff and merge tool designed to help users compare files, directories, and perform three-way merging. It offers a user-friendly interface that highlights differences between versions, making it easy to identify changes, resolve conflicts, and integrate modifications.
It's particularly useful for developers working with version control systems, as it can be configured as an external diff or merge tool for Git, SVN, Mercurial, and others. Meld supports comparing two or three files side-by-side, or two directories recursively, showing new, removed, and changed files. Its intuitive visual cues, such as color-coded lines and blocks, simplify the process of understanding complex changesets and merging diverging branches of code or text.
CAVEATS
Meld requires a graphical desktop environment to run, as it is a GUI application. It may consume significant system resources (CPU and memory) when comparing or merging very large files or recursively traversing extensive directory structures. While excellent for text-based content, its utility for binary file comparison is limited to showing them as different without detailed content analysis. Manual intervention is always required to resolve complex merge conflicts, as Meld assists in visualization but doesn't automatically resolve logical conflicts.
VERSION CONTROL SYSTEM INTEGRATION
Meld is widely used as an external diff and merge tool for popular VCS like Git, Subversion, and Mercurial. Its command-line options allow easy integration, enabling users to visually resolve conflicts or inspect changes directly from their version control workflow, replacing the default command-line tools with its graphical interface.
COMPARISON MODES
Meld supports two primary comparison modes: comparing two or three individual files, and comparing two directories recursively. In directory comparison, it visually indicates new, missing, or changed files, allowing users to drill down into file-level differences. The three-way merge mode is crucial for resolving conflicts arising from concurrent development, showing local changes, remote changes, and a common base version, facilitating manual conflict resolution.
HISTORY
Meld was originally created by Kai Willadsen in 2002. Developed primarily in Python and using the GTK+ toolkit, it quickly gained popularity as an intuitive visual diff and merge utility. It became an official GNOME project, further solidifying its position in the Linux desktop ecosystem. Its development has consistently focused on providing a user-friendly and powerful interface for code comparison and merging, making it a staple tool for developers and system administrators on Linux and other Unix-like systems.