GIT-MERGETOOL--LIB(1)
π git-mergetool--lib(1) β the Git Manual, but make it make sense
okay so bestie, welcome to the git-mergetool--lib page of the Git Manual. buckle up, this one's a little niche but she's iconic in her own way π
β¨ NAME β¨
git-mergetool--lib β common Git merge tool shell scriptlets π
πΈ SYNOPSIS πΈ
TOOL_MODE=(diff|merge) . "$(git --exec-path)/git-mergetool--lib"
π¦ DESCRIPTION π¦
okay so real talk: this is not a command the end user would want to run. ever. like, ever-ever π this documentation is meant for people who are studying the Porcelain-ish scripts and/or are writing new ones. it's giving backstage pass energy, not main character energy.
the git-mergetool--lib scriptlet is designed to be sourced (using .) by other shell scripts to set up functions for working with Git merge tools. she's a supporting actress, and she ate π«Ά
β οΈ before sourcinggit-mergetool--lib, your script must setTOOL_MODEto define the operation mode for the functions listed below.diffandmergeare valid values. noTOOL_MODE, no vibes. periodt.
π FUNCTIONS π
π get_merge_tool
returns a merge tool. the return code is 1 if we returned a guessed merge tool, else 0. $GIT_MERGETOOL_GUI may be set to true to search for the appropriate guitool π₯οΈβ¨
π get_merge_tool_cmd
returns the custom command for a merge tool.
π get_merge_tool_path
returns the custom path for a merge tool.
π initialize_merge_tool
brings merge tool specific functions into scope so they can be used or overridden. lowkey the glow-up function of the group ngl.
π run_merge_tool
launches a merge tool given the tool name and a true/false flag to indicate whether a merge base is present. $MERGED, $LOCAL, $REMOTE, and $BASE must be defined for use by the merge tool. like, all four, bestie β no skipping π
π GIT π
part of the git(1) suite β
and that's the whole page, bestie! this one's from Git 2.56.0, dated 2026-09-27 β go forth and source responsibly ππ¦
π¦ where this page comes from
- arch rolling: git 2.56.0-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms