Created
June 2, 2019 04:54
-
-
Save gen0083/a39d82e7dfc849add8db22dea98c215d to your computer and use it in GitHub Desktop.
This file contains hidden or 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/sh | |
git fetch origin master:master | |
git checkout master | |
git branch --merged master | grep -vE '^\*|\<master\>|\<develop\>' | xargs -I % git branch -d % | |
git branch -r --merged master | grep -vE '\<master\>|`\<develop\>`' | sed -e 's% *origin/%%' | xargs -I% git push --delete origin % | |
git fetch --prune |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
リモートのmasterブランチをfetchして最新状態に更新する
masterにチェックアウト後、masterにマージして不要になったローカルブランチ・リモートブランチを削除する
ブランチを作ってプルリクを送って、どれが不要になったかわからなくなるようなときに便利