どうするの
pull/<ID>/head
を fetch すればよい。意外と簡単。Fork ベースの PR を採用している場合はよく使うかも。ということで alias も用意する。
$ git fetch origin pull/<ID>/head:pull/<ID>
$ git checkout pull/<ID>
Git Alias
# .gitconfig 内
[alias]
copr = "!f(){ git fetch origin pull/$1/head:pull/$1 && git checkout pull/$1;};f"
使い方
$ git copr <Pull Request ID>