GH-PR-CLOSE(1)

πŸ’… gh-pr-close β€” bestie's guide to closing a PR

okay so real talk, this is the gh-pr-close page from the GitHub CLI manual (yes, the GH-PR-CLOSE(1) one, we're being fancy today ✨), and it's genuinely so simple it's giving "one job and she does it." You wanna close a pull request? Say less. 🫢


🌸 NAME 🌸

gh-pr-close β€” close a pull request. that's it. that's the whole vibe. πŸ’–


✨ SYNOPSIS ✨

gh pr close {<number> | <url> | <branch>} [flags]

so you point it at a PR and it closes it. and look, you've got options for how you point at it, because we're not gonna make you memorize numbers like some kind of monster:

  • a <number> β€” the PR's number, iconic and direct πŸ‘‘
  • a <url> β€” just paste the whole link, no thoughts needed πŸ¦‹
  • a <branch> β€” the branch name, for the girlies who think in branches

pick one, any one. then add your [flags] if you're feeling extra. πŸ’…


πŸŽ€ OPTIONS πŸŽ€

  • -c, --comment <string> β€” drop a closing comment on your way out. like leaving a little goodbye note but make it professional 😭 takes a <string>, obviously.
  • -d, --delete-branch β€” delete both the local and remote branch after the close. highkey the most satisfying flag on this whole page. clean up your mess, queen 🧹✨ (and yes, it's both β€” local and remote, no cap.)

πŸ’œ OPTIONS INHERITED FROM PARENT COMMANDS πŸ’œ

  • -R, --repo <[HOST/]OWNER/REPO> β€” pick a different repository using the [HOST/]OWNER/REPO format. so you can be like "not this one, that one" across the whole group chat 🌈

πŸ”₯ EXIT CODES πŸ”₯

vibe check time, here's what the numbers mean when she comes back:

  1. 0 β€” Successful execution. slay. it worked. πŸŽ‰
  2. 1 β€” Error. something went sideways, rip πŸ’€
  3. 2 β€” Command canceled. you (or something) hit the brakes πŸ™ˆ
  4. 4 β€” Authentication required. she doesn't know you like that yet, log in πŸ”
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information. fr fr, check the command's own help if you're getting a number that's not on this list πŸ‘€

πŸ¦‹ SEE ALSO πŸ¦‹

  • gh-pr(1) β€” the parent page, go say hi to the whole gh pr family, they miss you πŸ’–

and that's the whole page bestie!! no notes, ate and left no crumbs. 🌸

okay and for the little sign-off the manpage insists on: this was GitHub CLI v2.102.0, dated Oct 2026 β€” so go forth and close those PRs, you gorgeous main character, and remember: delete the branch, it's the right thing to do πŸ’…πŸŽ€

πŸ“¦ where this page comes from