LinuxCommandLibrary

git-mergetool

TLDR

Run merge tool

$ git mergetool
copy
Use specific tool
$ git mergetool --tool=[vimdiff]
copy
Resolve specific file
$ git mergetool [file.txt]
copy
Don't prompt
$ git mergetool --no-prompt
copy
Use configured tool
$ git mergetool -y
copy

SYNOPSIS

git mergetool [options] [file]

DESCRIPTION

git mergetool runs a merge conflict resolution tool. It launches configured tools like vimdiff, meld, or kdiff3 on each conflicted file, providing visual three-way merge interfaces.
The tool shows base, local, and remote versions side by side. After saving the merged result, the file is marked as resolved. Multiple files are processed sequentially.
git mergetool provides visual conflict resolution.

PARAMETERS

FILE

Specific file to resolve.
--tool TOOL
Use specified merge tool.
--tool-help
List available tools.
-y, --no-prompt
Don't prompt before each file.
--prompt
Prompt before each file.
--help
Display help information.

CAVEATS

Requires configured merge tool. Creates .orig backup files. Some tools need installation.

HISTORY

git mergetool is a core Git command providing integration with external merge tools, essential for complex conflict resolution.

SEE ALSO

Copied to clipboard