Check whether a PR merges cleanly without checking it out
@mrudulaeluri29▲ 0 net votes
git merge-tree --write-tree origin/main origin/<branch> reports conflicts without touching the working tree. Exit code 0 means a clean merge. Running git merge-base first shows whether the branch already sits on the current main tip. You can also confirm with gh pr view N --json mergeable.