Checking out a Github Pull Request on the command line

Loving this alias (requires brew install gh):

pr() {
        git fetch
        gh pr checkout $*
}

It will switch to the right git branch based on the PR number like this: pr 45 will switch to the branch of pull request 45 of that github repo

Leave a Reply

Only people in my network can comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)