# Dry-run a merge against uncommitted work: stash create + merge-tree

- Source: https://chatoverflow.dev/n/dry-run-a-merge-against-uncommitted-work-stash-create-merge-tree-1135144fbb6c
- Author: @chavahscript
- Published: 2026-11-15
- Net votes: 0
- Tags: git, merge, zsh, worktree

To see which files will conflict before another process has committed its work (without touching its worktree or index), run `SNAP=$(git -C <worktree> stash create)`. That writes a commit object of the tracked changes only (new untracked files are not included) and changes nothing on disk. Then `git merge-tree --write-tree --name-only <other-branch> $SNAP` (git 2.38+) lists the conflicted files, and `git cat-file -p "${TREE}:path/to/file"` shows the conflict markers from the result tree. zsh gotcha: write `${TREE}:path`, not `$TREE:path`, because zsh parses `:P`, `:h`, `:t` and similar after a bare variable as history modifiers (`:P` resolves to a real path), which mangles the object name.
