{
    "name": "GIT-MERGE-FILE(1)",
    "mode": "man",
    "parameter": "GIT-MERGE-FILE",
    "section": "1",
    "url": "/phpMan.php/man/GIT-MERGE-FILE/1/json",
    "generated": "2026-05-27T14:11:00Z",
    "synopsis": "git merge-file [-L <current-name> [-L <base-name> [-L <other-name>]]]\n[--ours|--theirs|--union] [-p|--stdout] [-q|--quiet] [--marker-size=<n>]\n[--[no-]diff3] <current-file> <base-file> <other-file>",
    "sections": [
        {
            "name": "NAME",
            "level": 1,
            "content": "git-merge-file - Run a three-way file merge\n",
            "subsections": []
        },
        {
            "name": "SYNOPSIS",
            "level": 1,
            "content": "git merge-file [-L <current-name> [-L <base-name> [-L <other-name>]]]\n[--ours|--theirs|--union] [-p|--stdout] [-q|--quiet] [--marker-size=<n>]\n[--[no-]diff3] <current-file> <base-file> <other-file>\n\n",
            "subsections": []
        },
        {
            "name": "DESCRIPTION",
            "level": 1,
            "content": "git merge-file incorporates all changes that lead from the <base-file> to <other-file> into\n<current-file>. The result ordinarily goes into <current-file>. git merge-file is useful for\ncombining separate changes to an original. Suppose <base-file> is the original, and both\n<current-file> and <other-file> are modifications of <base-file>, then git merge-file\ncombines both changes.\n\nA conflict occurs if both <current-file> and <other-file> have changes in a common segment of\nlines. If a conflict is found, git merge-file normally outputs a warning and brackets the\nconflict with lines containing <<<<<<< and >>>>>>> markers. A typical conflict will look like\nthis:\n\n<<<<<<< A\nlines in file A\n=======\nlines in file B\n>>>>>>> B\n\nIf there are conflicts, the user should edit the result and delete one of the alternatives.\nWhen --ours, --theirs, or --union option is in effect, however, these conflicts are resolved\nfavouring lines from <current-file>, lines from <other-file>, or lines from both\nrespectively. The length of the conflict markers can be given with the --marker-size option.\n\nThe exit value of this program is negative on error, and the number of conflicts otherwise\n(truncated to 127 if there are more than that many conflicts). If the merge was clean, the\nexit value is 0.\n\ngit merge-file is designed to be a minimal clone of RCS merge; that is, it implements all of\nRCS merge's functionality which is needed by git(1).\n",
            "subsections": []
        },
        {
            "name": "OPTIONS",
            "level": 1,
            "content": "-L <label>\nThis option may be given up to three times, and specifies labels to be used in place of\nthe corresponding file names in conflict reports. That is, git merge-file -L x -L y -L z\na b c generates output that looks like it came from files x, y and z instead of from\nfiles a, b and c.\n\n-p\nSend results to standard output instead of overwriting <current-file>.\n\n-q\nQuiet; do not warn about conflicts.\n\n--diff3\nShow conflicts in \"diff3\" style.\n\n--ours, --theirs, --union\nInstead of leaving conflicts in the file, resolve conflicts favouring our (or their or\nboth) side of the lines.\n",
            "subsections": []
        },
        {
            "name": "EXAMPLES",
            "level": 1,
            "content": "",
            "subsections": [
                {
                    "name": "git merge-file README.my README README.upstream",
                    "level": 2,
                    "content": "combines the changes of README.my and README.upstream since README, tries to merge them\nand writes the result into README.my.\n"
                },
                {
                    "name": "git merge-file -L a -L b -L c tmp/a123 tmp/b234 tmp/c345",
                    "level": 2,
                    "content": "merges tmp/a123 and tmp/c345 with the base tmp/b234, but uses labels a and c instead of\ntmp/a123 and tmp/c345.\n"
                }
            ]
        },
        {
            "name": "GIT",
            "level": 1,
            "content": "Part of the git(1) suite\n\n\n",
            "subsections": []
        },
        {
            "name": "Git 2.34.1                                   02/26/2026                            GIT-MERGE-FILE(1)",
            "level": 1,
            "content": "",
            "subsections": []
        }
    ]
}