LoginSignup
9
8

More than 5 years have passed since last update.

コマンドラインからPullRequest発行(テンプレートメンテナンスを楽にしたい)

Last updated at Posted at 2015-07-24

:dvd:Hubコマンドインストール

console
$ brew install hub

:banana:alias作成

.zshrcとかに
alias git=hub

:scroll:pull request テンプレートファイル作成

気になったら随時メンテナンス

~/.pullreqbody.txt
## :checkered_flag:目的

## :construction:変更点

## :flashlight:確認URL
<a href="http://qiita.com" target="_blank">qiita</a>

## :camera:スクリーンショット
#### 変更前

#### 変更後

## :white_check_mark:TODO
- [ ]
- [ ]
- [ ]

:banana:gitconfigにailias追加

uri-encodeにperlを利用している、動作環境が無ければそこを変えて下さい。
macなら動くはず!

.gitconfig
[alias]
  pr = !hub browse -- compare/$(git symbolic-ref --short HEAD)'?'expand=1'&'body=$(cat ~/.pullreqbody.txt | perl -pe 'encode_utf8' | perl -pe 's/([^ 0-9a-zA-Z])/\"%\".uc(unpack(\"H2\",$1))/eg' | perl -pe 's/ /+/g')

titleも含めたければ、'&'title=
で追記出来たはず(未確認)

準備完了

pull request 作成

console
#対象ブランチのところで
$ git pr

image

参考

http://qiita.com/kasaharu/items/3ead40e6838fbb44d4cd
http://qiita.com/yoshimikeisui/items/0719b0c9994f8d635356
http://unicus.jp/skmk/archives/315

9
8
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
9
8