GH-PR-MERGE(1)

πŸ’– NAME πŸ’–

gh-pr-merge β€” Merge a pull request. This is GH-PR-MERGE(1) from the GitHub CLI manual, and tbh it’s giving β€œlet’s merge this PR and make it everyone’s problem in the best way.” πŸ’…


✨ SYNOPSIS ✨

gh pr merge [<number> | <url> | <branch>] [flags]

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so bestie, this command merges a pull request on GitHub. Simple concept, iconic execution. ✨

No argument? Then it selects the pull request that belongs to the current branch. Lowkey convenient, highkey slay.

When targeting a branch that requires a merge queue, no merge strategy is required. If required checks have not yet passed, auto-merge will be enabled. If required checks have passed, the pull request will be added to the merge queue. To bypass a merge queue and merge directly, pass the --admin flag. Periodt. πŸ‘‘


πŸŽ€ OPTIONS πŸŽ€

  • --admin β€” Use administrator privileges to merge a pull request that does not meet requirements.
  • -A, --author-email <text> β€” Email text for merge commit author.
  • --auto β€” Automatically merge only after necessary requirements are met.
  • -b, --body <text> β€” Body text for the merge commit.
  • -F, --body-file <file> β€” Read body text from file (use "-" to read from standard input).
  • -d, --delete-branch β€” Delete the local and remote branch after merge.
  • --disable-auto β€” Disable auto-merge for this pull request.
  • --match-head-commit <SHA> β€” Commit SHA that the pull request head must match to allow merge.
  • -m, --merge β€” Merge the commits with the base branch.
  • -r, --rebase β€” Rebase the commits onto the base branch.
  • -s, --squash β€” Squash the commits into one commit and merge it into the base branch.
  • -t, --subject <text> β€” Subject text for the merge commit.

🌈 OPTIONS INHERITED FROM PARENT COMMANDS 🌈

  • -R, --repo <[HOST/]OWNER/REPO> β€” Select another repository using the [HOST/]OWNER/REPO format.

πŸ“ EXIT CODES πŸ“

  • 0: Successful execution
  • 1: Error
  • 2: Command canceled
  • 4: Authentication required
NOTE: Specific commands may have additional exit codes. Refer to the command’s help for more information. 🫢

🫢 SEE ALSO 🫢


mwah πŸ’‹ β€” this little page is from GitHub CLI v2.102.0, dated Oct 2026, and that’s the cute sign-off tea. πŸŽ€βœ¨

πŸ“¦ where this page comes from