Created
July 26, 2018 01:27
-
-
Save kazoo0217/142397dfcfd194e01395db07ec443f9a to your computer and use it in GitHub Desktop.
master ブランチをプッシュして、マージ済みブランチ(ローカル・リモート)を削除する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## master ブランチをプッシュして、マージ済みブランチ(ローカル・リモート)を削除する | |
## マージ済みブランチは引数で指定する。 | |
## `~/git-push-master.sh topic_issue99` とか `~/git-push-master.sh issue/99` | |
# error で中断 | |
set -e | |
# 引数1つめを変数に代入 | |
BRANCH=$1 | |
# 順番に実行 | |
git push origin master && \ | |
git branch -d $BRANCH && \ | |
git push --delete origin $BRANCH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment