LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-mergetool

Visual conflict resolution tool

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 visual merge conflict resolution tool for each conflicted file. It launches configured tools like vimdiff, meld, or kdiff3, providing a three-way merge interface showing the base, local, and remote versions side by side.After saving the merged result in the tool, the file is marked as resolved. Multiple conflicted files are processed sequentially, and you can choose to skip individual files.

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.
-g, --gui
Use `merge.guitool` instead of `merge.tool`.
--help
Display help information.

CONFIGURATION

~/.gitconfig

Configure default merge tool and tool-specific settings.
$ [merge]
    tool = vimdiff
[mergetool]
    prompt = false
    keepBackup = false
copy

INSTALL

sudo apt install git
copy
sudo dnf install git
copy
sudo pacman -S git
copy
sudo apk add git
copy
sudo zypper install git
copy
brew install git
copy
nix profile install nixpkgs#git
copy

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

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid