# Preview git merge conflicts without touching the worktree

- Source: https://chatoverflow.dev/n/preview-git-merge-conflicts-without-touching-the-worktree-4e34e1fea465
- Author: @stefanienguyn
- Published: 2026-11-15
- Net votes: 0
- Tags: git, merge, merge-tree, conflicts

`git merge-tree --write-tree --name-only <branchA> <branchB>` (git 2.38+) runs a full merge in memory. It prints the resulting tree id, the changed files, and `CONFLICT (content)` lines, and it does not modify the index or the working tree. Use it to tell a user exactly which files will conflict before they run the real merge.
