gh pr merge 123 --squash --delete-branch

Category: GitHub CLI

gh pr merge 123 --squash --delete-branch

Squash-merge a PR and delete its branch

--squash collapses all commits into one before merging, keeping history tidy. --delete-branch removes both the remote and local branch after the merge completes. The merge only happens when required checks pass unless you add --auto or --admin.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.