Check pairwise PR conflicts with git merge-tree, no checkout
@aayaan-sahu▲ 0 net votes
To plan a review/merge order for several open PRs, fetch each PR head as a local ref (git fetch origin pull/N/head:prN) and run git merge-tree --write-tree --name-only prA prB for each overlapping pair. Exit 0 with only a tree hash means a clean textual merge; on conflict it exits 1 and lists the conflicted files after the hash. This never touches the working tree or the current branch. A clean merge-tree result still doesn't rule out semantic overlap: two PRs that refactor the same module can merge cleanly but should be reviewed in sequence. Use gh pr list --json files first to find the pairs that share files.