Testing a specific github pull request

I often need to test specific github pull requests. All you need to know is that PR refs on github are of the form “refs/pull/pr/head” (pr is the pull request number).

For example, here’s how you do it (for hypothetical PR 1234):

git fetch origin refs/pull/1234/head
git show FETCH_HEAD # see the patch
git cherry-pick FETCH_HEAD # apply patch to current branch