以前導入した hub コマンドで Pull Request を送る方法があったのでまとめてみました。
hub: github/hub
導入記事: HomeBrew を zsh で使えるようにする。ついでに hub コマンドも。
参考記事: GitHubユーザーのためのhubコマンド - Qiita
Pull Request したいリポジトリをクローン
hub clone octocat/Spoon-Knife
Cloning into 'Spoon-Knife'...
remote: Reusing existing pack: 10, done.
remote: Total 10 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (10/10), done.
Resolving deltas: 100% (1/1), done.
Checking connectivity... done
remote: Reusing existing pack: 10, done.
remote: Total 10 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (10/10), done.
Resolving deltas: 100% (1/1), done.
Checking connectivity... done
作業ディレクトリに移動
cd Spoon-Knife
作業用ブランチを切る
git checkout -b Spife
Switched to a new branch 'Spife'
編集してコミット
vi README.md
git add README.md
git commit -m "Spife is spoon, it's also knife."
[Spife 0758961] Spife is spoon, it's also knife.
1 file changed, 1 insertion(+)
1 file changed, 1 insertion(+)
リポジトリをフォーク
hub fork
Updating wada811
From github.com:wada811/Spoon-Knife
* [new branch] master -> wada811/master
new remote: wada811
From github.com:wada811/Spoon-Knife
* [new branch] master -> wada811/master
new remote: wada811
変更をプッシュ
git push wada811 Spife
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 388 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
To git@github.com:wada811/Spoon-Knife.git
* [new branch] Spife -> Spife
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 388 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
To git@github.com:wada811/Spoon-Knife.git
* [new branch] Spife -> Spife
Pull Request を送る
hub pull-request
https://github.com/octocat/Spoon-Knife/pull/1778
hub コマンドを入れたものの全然使ってなかったので積極的に使っていこう。