Created
April 25, 2016 02:35
-
-
Save tamanugi/84c39b49bc937230c9b80e93aa10c43e to your computer and use it in GitHub Desktop.
[Git]マージ済みのリモートブランチを一括削除 ref: http://qiita.com/tamanugi/items/d8fd05eae82a410cad6b
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
git checkout master | |
git branch -r --merged | grep -v master | sed -e "s|origin/||" | xargs git push --delete origin |
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
git branch -r --merged #現在いるブランチにマージ済みのリモートブランチを表示 | |
grep -v master #masterを含む行を除外(場合によってはdevelopも追加する | |
sed -d "s|origin/||" #origin/ を置換 | |
git push --delete origin foo #fooブランチを削除 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment