Merge PR
Overview
Merge a prepared PR via gh pr merge --squash and clean up the worktree after success.
Safety
- •Use
gh pr merge --squashas the only path tomain. - •Do not run
git pushat all during merge.
Steps
- •Identify PR meta
- •Run sanity checks (not draft, checks passing, not behind main)
- •Merge PR:
gh pr merge <PR> --squash --delete-branch- •If checks still running: use
--autoto queue
- •If checks still running: use
- •Get merge SHA
- •Comment on PR thanking contributor
- •Verify PR state is MERGED (never CLOSED)
- •Clean up worktree only on success
Guardrails
- •Worktree only.
- •Do not close PRs.
- •End in MERGED state.
- •Clean up only after merge success.
- •Never push to main. Use
gh pr merge --squashonly.