Created
November 3, 2016 14:16
-
-
Save bananita/fe0c456feeac73c19404465bf1a57dd7 to your computer and use it in GitHub Desktop.
remove merged branchs
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 | |
echo Deleting merged branches... | |
#git pull | |
for b in $(git branch -a --merged develop); | |
do | |
branch=${b#"remotes/origin/"} | |
if [[ "$branch" == "develop" ]]; then | |
continue | |
fi | |
if [[ "$branch" == "master" ]]; then | |
continue | |
fi | |
if [[ "$branch" == "release*" ]]; then | |
continue | |
fi | |
echo Deleting $branch... | |
# git branch -d $branch | |
git push origin :$branch | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment