oinume journal

Scratchpad of what I learned

ターミナルとキーボードだけでプルリクエストを送る

これはSending pull-request only with terminal and keyboardの日本語の記事です。

必要なもの

  • Mac
  • Terminal
  • hub command (brew install hubでインストールしておく)

How to send pull-request

ブランチを作る

$ git checkout -b new-cool-feature

ソースを編集する

$ git commit -a

わざとgit pushしてエラーにして、正しいコマンドをpbcopyでクリップボードにコピー

$ git push 2>&1 | grep git | pbcopy

Cmd+Vでペーストしてpush

$ git push --set-upstream origin new-cool-feature

Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 324 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
To git@github.com:example/example-project.git
 * [new branch]      new-cool-feature -> new-cool-feature
Branch new-cool-feature set up to track remote branch new-cool-feature from origin.

hubコマンドでプルリクエストを作成

$ hub pull-request
https://github.com/example/example-project/pull/1

もしくは

$ hub browse

でブラウザでgithub.comを開いて画面からプルリクエストを作成