git-merge-tree
Preview merge without modifying tree
TLDR
SYNOPSIS
git merge-tree [options] base branch1 branch2
DESCRIPTION
git merge-tree performs a three-way merge without touching the index or working tree. It shows what a merge would produce, making it useful for previewing merges or performing scripted merge analysis.
The traditional mode requires specifying the base commit explicitly. Modern mode (`--write-tree`, added in Git 2.38) automatically finds the merge base and reports conflicts without actually merging, making it ideal for CI pipelines and automation scripts.
PARAMETERS
BASE
Common ancestor commit.BRANCH1
First branch to merge.BRANCH2
Second branch to merge.--write-tree
Modern mode: write result tree.--trivial-merge
Only trivial merges.--help
Display help information.
CAVEATS
Plumbing command. Output format varies by mode. Modern mode added in Git 2.38.
HISTORY
git merge-tree is a Git plumbing command enhanced in Git 2.38 with --write-tree mode for easier programmatic merge testing.
SEE ALSO
git-merge(1), git-merge-file(1)

