summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bash_profile10
1 files changed, 8 insertions, 2 deletions
diff --git a/.bash_profile b/.bash_profile
index 7ba48f2..03b8734 100644
--- a/.bash_profile
+++ b/.bash_profile
@@ -45,8 +45,14 @@ function pm() {
}
function killmerged() {
- for b in $(git branch --merged HEAD --no-contains HEAD|grep -vE 'stage|master|svn|develop'); do
- git branch -d $b && git push origin :$b
+ local -a branches=( $( \
+ git branch --merged HEAD --no-contains HEAD --format '%(refname)' | \
+ grep -vE '^refs/heads/(stage|master|svn|develop|uat|stable|live-testing)$' \
+ ) )
+ branches=( "${branches[@]#refs/heads/}" )
+ for b in "${branches[@]}"
+ do
+ git branch -d $b
done
}