{
    "mode": "man",
    "parameter": "git-mergetool--lib",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/git-mergetool--lib/1/json",
    "generated": "2026-06-13T22:07:54Z",
    "synopsis": "TOOLMODE=(diff|merge) . \"$(git --exec-path)/git-mergetool--lib\"",
    "sections": {
        "NAME": {
            "content": "git-mergetool--lib - Common Git merge tool shell scriptlets\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "TOOLMODE=(diff|merge) . \"$(git --exec-path)/git-mergetool--lib\"\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This is not a command the end user would want to run. Ever. This documentation is meant for\npeople who are studying the Porcelain-ish scripts and/or are writing new ones.\n\nThe git-mergetool--lib scriptlet is designed to be sourced (using .) by other shell scripts\nto set up functions for working with Git merge tools.\n\nBefore sourcing git-mergetool--lib, your script must set TOOLMODE to define the operation\nmode for the functions listed below. diff and merge are valid values.\n",
            "subsections": []
        },
        "FUNCTIONS": {
            "content": "getmergetool\nreturns a merge tool. the return code is 1 if we returned a guessed merge tool, else 0.\n$GITMERGETOOLGUI may be set to true to search for the appropriate guitool.\n\ngetmergetoolcmd\nreturns the custom command for a merge tool.\n\ngetmergetoolpath\nreturns the custom path for a merge tool.\n\ninitializemergetool\nbring merge tool specific functions into scope so they can be used or overridden.\n\nrunmergetool\nlaunches a merge tool given the tool name and a true/false flag to indicate whether a\nmerge base is present.  $MERGED, $LOCAL, $REMOTE, and $BASE must be defined for use by\nthe merge tool.\n",
            "subsections": []
        },
        "GIT": {
            "content": "Part of the git(1) suite\n\n\n\nGit 2.34.1                                   02/26/2026                         GIT-MERGETOOL--LI(1)",
            "subsections": []
        }
    },
    "summary": "git-mergetool--lib - Common Git merge tool shell scriptlets",
    "flags": [],
    "examples": [],
    "see_also": []
}