git-flowとhubコマンドを使ってCUIでgithubを活用する
github/hubコマンドを使ってみた - ぷろみんの続きです
概要
git-flowとhubを使います。
インストール
$ sudo apt-get install -y git-flow
初期化
$ mkdir foo $ cd foo # hub導入済み $ git init -g $ git flow init # 質問には全部エンター $ git create $ echo '# foo' >> README.md $ git add . $ git commit -m 'Initial commit' $ git push --all
開発
# issue create [-m <MESSAGE>|-f <FILE>] [-l <LABEL-1>,<LABEL-2>...,<LABEL-N>] $ git issue create -m 'LICENSEを追加する' # issueを解決するブランチを作成する $ git flow feature start add_license
licenseの追加にはliceを使ってみようかと思います。
$ sudo pip install lice $ lice mit > LICENSE
featureブランチでissueを解決し、プッシュします。
$ git add . $ git commit -m 'close #1' $ git flow feature publish add_license
そして、その変更を取り込んでもらえるようにpull-requestを送ります。
$ git pull-request -m "Add license" -b develop -h feature/add_license
問題無ければマージします。
$ git checkout develop
$ git merge https://github.com/YOUR_USER/CURRENT_REPO/pull/2
$ git push origin develop
ここもhubさんの力でgit pr-merge 2
とかできたら良かったんですけどねー。
issueが全て片付いたので、masterへマージします。
$ git checkout master $ git merge develop $ git push origin master
githubで確認すると無事にissueがcloseされました。
参考
terminal - git auto-complete for *branches* at the command line? - Ask Different