LoginSignup
1
2

More than 5 years have passed since last update.

GitHub PR を local に fetch して checkout する

Last updated at Posted at 2017-06-12

どうするの

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>

参考

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2