Any github Pull Request (PR) can be used locally, even before it’s been accepted. Simply copy the #ID after the PR title, or from the URL: /pull/ID.

From the repo’s folder:

git fetch origin pull/ID/head:NAME
git checkout NAME

For example:

git fetch origin pull/123/head:123 && git checkout 123

More info: Checking out pull requests locally


You can make this a convenient alias. For example, with Powershell:

git config --global `
alias.pr '!git fetch origin pull/"$1"/head:"$1" && git checkout "$1" #'

git pr 123

Source: Tom Hale - Git alias with positional parameters