Created
February 3, 2015 21:39
-
-
Save tomleo/8a0a6d3c6d6dd83374ff to your computer and use it in GitHub Desktop.
Cleaning up remote branches
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
#! /bin/bash | |
array=( | |
'feature-branch-1' | |
'feature-branch-2' | |
'feature-branch-3' | |
'feature-branch-4' | |
'feature-branch-5' | |
) | |
for i in "${array[@]}"; do | |
if git branch -a --merged | grep -q $i; then | |
git push origin :$i | |
else | |
echo "Branch $i has not been merged" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment