2014/07/08

github の pull-request を clone する設定をいつも思い出せなくて、毎回ググってるので alias を書いた。
Checkout github pull requests locally

Here's fetch : 1 git fetch From github.com:gittip/www.gittip.com * [new ref] refs/pull/100/head -> o...

https://gist.github.com/piscisaureus/3342247
$ git config --global alias.pr-setup "config --add remote.origin.fetch +refs/pull/*/head:refs/remotes/origin/pr/*"
とすれば alias がインストールされるので、以後は pull-request を監視したいリポジトリを clone した後 $ git pr-setup とすれば .git/config に上記リンク先の設定が入る。後は普通に $ git fetch origin
$ git checkout pr/999
とかすればいい。ちなみに clone した瞬間に設定する方法無いかなーと思ったけど、clone したいだけのリポジトリで勝手に fetch されて太っても嫌だなーと思ったので手動で pr-setup を叩く事にする。
Posted at 11:07 | WriteBacks () | Edit
Edit this entry...

wikieditish message: Ready to edit this entry.






















A quick preview will be rendered here when you click "Preview" button.