Created
December 17, 2019 04:30
-
-
Save wizact/1bf95f07c13666d045a028f13d8b3af1 to your computer and use it in GitHub Desktop.
Delete all merged branches
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/bash | |
git checkout master | |
for branch_name in $(git branch --merged| egrep -v "(^\*|master|release|integrate)") | |
do | |
git tag archive/$branch_name $branch_name | |
git branch -d $branch_name | |
done | |
git tag | grep archive/ | xargs -n 1 git push -d origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment