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.