hub-pr(1)

πŸ’… NAME πŸ’…

okay so bestie, welcome to hub-pr β€” the part of the hub manual that's literally all about managing GitHub Pull Requests for the current repository. that's it, that's the whole vibe. PRs. current repo. iconic. πŸŽ€


✨ SYNOPSIS ✨

like, here's how you actually call it:

hub pr list [-s STATE] [-h HEAD] [-b BASE] [-o SORT_KEY [-^]] [-f
FORMAT] [-L LIMIT]
hub pr checkout PR-NUMBER [BRANCH]
hub pr show [-uc] [-f FORMAT] [-h HEAD]
hub pr show [-uc] [-f FORMAT] PR-NUMBER

no cap, that's the whole shape of it. πŸ¦‹


🌸 COMMANDS 🌸

  • list β€” lists the pull requests in the current repository. that's the whole job, and she does it well. πŸ’–
  • checkout β€” checks out the head of a pull request into a new branch. main character behaviour fr fr. and listen: to update the pull request with new commits, use git push. that's the move, okay? πŸ‘‘
  • show β€” opens a pull request page in a web browser. when no PR-NUMBER is specified, HEAD is used to look up open pull requests and defaults to the current branch name. and if you pass --format, it prints information about the pull request instead of opening it. so you get the tea in the terminal instead of the browser. 🫢

πŸ”₯ OPTIONS πŸ”₯

  • -s, --state STATE β€” filters pull requests by STATE. supported values are: "open" (default), "closed", "merged", or "all". yes bestie, "open" is the default, don't come for me. ✨
  • -h, --head BRANCH β€” shows pull requests started from the specified head BRANCH. the "OWNER:BRANCH" format must be used for pull requests from forks. important!! fork PRs need the owner prefix, iykyk. πŸ“
  • -b, --base BRANCH β€” shows pull requests based off the specified BRANCH. simple, clean, slaying. 🌈
  • -f, --format FORMAT β€” pretty prints the list of pull requests using format FORMAT. the default is:
"%pC%>(8)%i%Creset  %t%  l%n"

see the "PRETTY FORMATS" section of git-log(1) for some additional details on how placeholders are used in format. and here are all the available placeholders, no skips, we're listing every single one:

  • %I: pull request number
  • %i: pull request number prefixed with #
  • %U: the URL of this pull request
  • %S: state ("open" or "closed")
  • %pS: pull request state ("open", "draft", "merged", or "closed")
  • %sC: set color to red or green, depending on state
  • %pC: set color according to pull request state
  • %t: title
  • %l: colored labels
  • %L: raw, comma-separated labels
  • %b: body
  • %B: base branch
  • %sB: base commit SHA
  • %H: head branch
  • %sH: head commit SHA
  • %sm: merge commit SHA
  • %au: login name of author
  • %as: comma-separated list of assignees
  • %rs: comma-separated list of requested reviewers
  • %Mn: milestone number
  • %Mt: milestone title
  • %cD: created date-only (no time of day)
  • %cr: created date, relative
  • %ct: created date, UNIX timestamp
  • %cI: created date, ISO 8601 format
  • %uD: updated date-only (no time of day)
  • %ur: updated date, relative
  • %ut: updated date, UNIX timestamp
  • %uI: updated date, ISO 8601 format
  • %mD: merged date-only (no time of day)
  • %mr: merged date, relative
  • %mt: merged date, UNIX timestamp
  • %mI: merged date, ISO 8601 format
  • %n: newline
  • %%: a literal %

πŸ’€ that's a lot of placeholders but we ate, every single one made it. 🧚

  • --color[=WHEN] β€” enables colored output even if stdout is not a terminal. WHEN can be one of "always" (default for --color), "never", or "auto" (default). so --color bare = always, but the overall default when you don't say anything = auto. cute. πŸ’œ
  • -o, --sort KEY β€” sorts displayed pull requests by "created" (default), "updated", "popularity", or "long-running". created is the default, in case you were wondering. 🌸
  • -^, --sort-ascending β€” sorts by ascending dates instead of descending. yes, the flag is literally a lil caret. adorable. πŸ”₯
  • -L, --limit LIMIT β€” displays only the first LIMIT pull requests. restraint. we love her. 😭
  • -u, --url β€” prints the pull request URL instead of opening it. for the copy-paste girlies. 🫢
  • -c, --copy β€” puts the pull request URL to clipboard instead of opening it. even more convenient, lowkey obsessed. πŸ’…

quick vibe check: -u and -c both stop the browser from opening β€” one prints the URL, one copies it. no guesses beyond what the page says, bestie, just the facts. ✨

πŸ¦‹ SEE ALSO πŸ¦‹

go read these too, they're in the same friend group:


okay and finally, the sign-off πŸŽ€ β€” this whole page is hub version 2.14.2, dated 07 Jan 2024, and it's the hub-pr(1) page from the hub manual. that's a wrap, bestie. go slay some PRs. πŸ’–πŸ‘‘

πŸ“¦ where this page comes from