How to pull a pull request from upstream in github

You should be able to do this by first adding the upstream as remote, and then pulling the pull request:

git remote add upstream https://github.com/USER/repository.git
git pull upstream pull/ID/head:BRANCHNAME
git checkout BRANCHNAME

Where USER is not your username but the original one (the one you forked from), ID is the pull-request id and BRANCHNAME will be the local branch name corresponding to the pull-request.

If you want to push to your own fork later, you will likely have to set the upstream (from BRANCHNAME):

git push -u origin BRANCHNAME

See https://help.github.com/articles/checking-out-pull-requests-locally/:

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

where ID is the pull request number and BRANCHNAME is an arbitrary name for the new local branch.