Skip to content

Instantly share code, notes, and snippets.

@kazoo0217
Created July 26, 2018 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kazoo0217/142397dfcfd194e01395db07ec443f9a to your computer and use it in GitHub Desktop.
Save kazoo0217/142397dfcfd194e01395db07ec443f9a to your computer and use it in GitHub Desktop.
master ブランチをプッシュして、マージ済みブランチ(ローカル・リモート)を削除する
#!/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