GIT-PR(1)
okay so bestie, welcome to git-pr(1) β that's the pull-request-wrangling page from the Git Extras collection, manual section 1. Grab a snack, we're checking out pull requests and it's gonna be adorable π
β¨ NAME β¨
git-pr β checks out a pull request locally. that's it. that's the whole job. iconic behavior honestly π
π¦ SYNOPSIS π¦
git-pr [-m|--merge] <number> [<remote>]
git-pr [-m|--merge] <[remote]:number>...
git-pr [-m|--merge] <url>...
git-pr clean
π DESCRIPTION π
It makes you a local branch based on a GitHub pull request number or URL, and then β the way that it just switches you to that branch afterwards β chef's kiss. You don't lift a finger. You're just there. π«Ά
πΈ OPTIONS πΈ
<remote>β the name of the remote you wanna fetch from. defaults toorigin, as it should. β¨<url>β a GitHub pull request URL, and it has to be in this format:https://github.com/tj/git-extras/pull/453. Exactly like that. no freestyling. π-m,--mergeβ check out a merge commit against the branch the pull request is targeting. heads up though: this one uses a private API where GitHub checks the pull request's mergeability, so it only works with the opened pull request. and if the merge commit isn't up-to-date? you gotta go visit the pull request web page yourself to trigger the rebuild. annoying but true π
π EXAMPLES π
checking out 226 from origin π
$ git pr 226
remote: Counting objects: 12, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 12 (delta 3), reused 9 (delta 3)
Unpacking objects: 100% (12/12), done.
From https://github.com/tj/git-extras
* [new ref] refs/pull/226/head -> pr/226
Switched to branch 'pr/226'
the * [new ref] line? that's the moment. and then it just puts you on pr/226. slay.
pulling from a different remote π§
$ git pr 226 upstream
and this does the exact same thing as the one above π
$ git pr upstream:226
two ways, same vibe. iykyk.
checking out a pull request from a GitHub URL π
$ git pr https://github.com/tj/git-extras/pull/453
From https://github.com/tj/git-extras
* [new ref] refs/pull/453/head -> pr/453
Switched to branch 'pr/453'
multiple pull requests?? yes bestie, we can do that π
via the GitHub URL, or the ID with the remote specified:
$ git pr upstream:226 upstream:443
$ git pr upstream:443 https://github.com/tj/git-extras/pull/453
note thatgit pr PR-A PR-Bis equal to:plain $ git pr PR-A $ git pr PR-Bso if one of the pull requests fails to pull, this command will still go ahead and pull the others. the final exit code is decided by the result of the final pulling. one flop β whole flop. π
and with --merge you can check out a merge commit π₯
$ git pr origin:755 --merge
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From github.com:tj/git-extras
bf7dd69..de6e51c refs/pull/755/merge -> pr/755
Switched to branch 'pr/775'
$ git log pr/775 --oneline
de6e51c (pr/755) Merge bf7dd6...
and to clean up old branches π§Ήβ¨
$ git pr clean
Deleted branch pr/226 (was b96a8c2).
Deleted branch pr/220 (was d34dc0f).
Deleted branch pr/775 (was de6e51c).
the way it just cleans house and tells you the old SHA like a lil receipt... obsessed. π
π AUTHOR π
Originally from https://gist.github.com/gnarf/5406589 β shoutout to the original plug. π«Ά
π¨ REPORTING BUGS π¨
found something cursed? tell the world (respectfully) at:
π SEE ALSO π
and that's the whole page bestie, no cap. this was Git Extras, GIT-PR(1), dated May 2026 β now go forth and check out your pull requests. periodt. π
β¨
π¦ where this page comes from
- ubuntu stonking: git-extras 7.5.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms