bash list_merged_remote_and_delete.sh
Last active
July 19, 2018 06:42
-
-
Save zsoobhan/53b598da50a5496f655a07bb9fb39151 to your computer and use it in GitHub Desktop.
Lists all branches on remote repository that are merged to develop
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 develop | | |
grep origin | | |
grep -v develop | | |
grep -v release | | |
grep -v master | | |
sed -E "s|^ *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
for branch in $(git branch -r --merged develop | grep origin | grep -v develop | grep -v release | grep -v master | sed -E "s|^ *origin/||g") | |
do | |
git push origin $branch --delete | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment