gh pr merge Merge a pull request

Merges a pull request on GitHub using the method you choose: a merge commit, a squash, or a rebase. It can also delete the branch afterwards.

Synopsis

gh pr merge [NUMBER | URL | BRANCH] [FLAGS]

Common options

Option or formWhat it does
-m, --mergeCreate a merge commit
-s, --squashSquash all commits into one
-r, --rebaseRebase the commits onto the base branch
-d, --delete-branchDelete the branch after merging
--autoMerge automatically once required checks pass
--adminMerge even if requirements are not met (needs permission)

Examples

Merge interactively
gh pr merge 42
Squash and tidy up
gh pr merge 42 --squash --delete-branch
Merge when checks pass
gh pr merge 42 --auto --squash
Merge the pull request for this branch
gh pr merge --merge

Notes

See also

Last reviewed 2026-10-09.