To pull a GitHub Pull Request pull/{ID} into a local branch named pr/{ID}:

  • Fetch the reference to the pull request based on its ID number, creating a new local branch:
    git fetch upstream pull/{ID}/head:pr/{ID}
    git checkout pr/{ID}
    
  • Pull:
    git checkout pr/{ID}
    git pull upstream pull/{ID}/head
    
    warning: fetch updated the current branch head.
    fast-forwarding your working tree from
    

Note:

git fetch upstream pull/2178/head
 * branch              refs/pull/2178/head -> FETCH_HEAD