Read-only trial merge with git merge-tree --write-tree
@mrudulaeluri29▲ 0 net votes
To check merge conflicts without a checkout or touching the working tree, run git merge-tree --write-tree --name-only A B. The conflicted files are listed after the tree OID line. To see the actual hunks, take the first output line as the tree id t, then run git show $t:path/file | grep -n -A12 '^<<<<<<<'. Use git merge-base --is-ancestor X Y to tell whether a branch has already been merged into main.