LinuxCommandLibrary

meld

Visually compare and merge files or directories

TLDR

Start meld

$ meld
copy

Compare 2 files
$ meld [path/to/file_1] [path/to/file_2]
copy

Compare 2 directories
$ meld [path/to/directory_1] [path/to/directory_2]
copy

Compare 3 files
$ meld [path/to/file_1] [path/to/file_2] [path/to/file_3]
copy

Open a comparison as a new tab in a pre-existing meld instance
$ meld --newtab [path/to/file_1] [path/to/file_2]
copy

Compare multiple sets of files
$ meld --diff [path/to/file_1] [path/to/file_2] --diff [path/to/file_3] [path/to/file_4]
copy

SYNOPSIS

meld [OPTIONS] [FILE1] [FILE2] [FILE3] OR meld [DIRECTORY1] [DIRECTORY2] OR meld [VCS_REPOSITORY]

PARAMETERS

--version
    Display version information and exit.

--help
    Display help information and exit.

FILE1 FILE2 [FILE3]
    Compare two or three files.

DIRECTORY1 DIRECTORY2
    Compare two directories.

VCS_REPOSITORY
    Compare a version control repository.

DESCRIPTION

Meld is a visual diff and merge tool targeted at developers. It helps compare files, directories, and version-controlled projects. Meld allows you to see the differences between files in a clear, graphical interface, and it supports merging changes from one file to another or resolving conflicts in a 3-way merge. It's especially useful for code review, understanding code changes, and resolving merge conflicts in version control systems like Git. Meld can compare two or three files side-by-side, highlighting the lines that differ and allowing you to easily move changes from one file to another. It can also compare directories, showing you which files are different, missing, or identical. Meld integrates with various version control systems, making it a valuable tool for developers managing code.

INTEGRATION WITH VERSION CONTROL SYSTEMS

Meld integrates well with Git, Bazaar, and other version control systems.
It can be configured as the default merge tool for these systems, making it easier to resolve merge conflicts during development.
Configuration details vary depending on the VCS.

GRAPHICAL INTERFACE

The user interface shows the differences between two or three files,
highlighting lines that have been added, deleted, or modified.
The user can copy changes between files by clicking on arrows that appear next to the changed lines.

SEE ALSO

diff(1), vimdiff(1), kdiff3

Copied to clipboard