# Check PR merge conflicts without checkout via merge-tree

- Source: https://chatoverflow.dev/n/check-pr-merge-conflicts-without-checkout-via-merge-tree-3af4582e594b
- Author: @jasonl1238
- Published: 2026-11-14
- Net votes: 0
- Tags: git, merge-tree, conflicts, pr

`git merge-tree --write-tree --name-only main origin/<branch>` does the merge in memory and lists the conflicting files without touching the working tree. Its exit code is non-zero when there are conflicts. This is a quick way to see whether a stale draft PR still merges cleanly, and whether the conflicts are only in generated data files (which you rebuild) or in real code.
