summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2024-05-24 15:41:11 +0100
committerdakkar <dakkar@thenautilus.net>2024-05-24 15:41:11 +0100
commit777ea7772198d907f818df15f7e8114390379cc3 (patch)
tree11aa8618d9e75ede29d645ddaad2d915c5192e07
parentbetter less colors on dark bg (diff)
downloaddotfiles-777ea7772198d907f818df15f7e8114390379cc3.tar.gz
dotfiles-777ea7772198d907f818df15f7e8114390379cc3.tar.bz2
dotfiles-777ea7772198d907f818df15f7e8114390379cc3.zip
less aggressive killmerged
-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
}