タイトルの通りです。
いつも発行している
git push origin branchName
をコマンド一発でやりたいと思って作成しました。
bash_profileの編集
bash_profileに以下を追加します。
まずviで編集します
command
$ vi ~/.bash_profile
これを追加します。
bash_profile
alias mygitpush="git branch |grep \"* \"|awk '{if (\$2 != \"develop\" && \$2 != \"master\") {print \$2 } else {print \"Carefull!! This branch is develop or master!!!\"; exit } }'| xargs git push origin "
再読み込み
追加したら、再読み込みします。
command
$ source ~/.bash_profile
実行
gitのワークスペース内で以下を実行したらmaster,developのブランチ以外でpushできます。
command
$ mygitpush
という怠けようコマンドでした。