1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-12-22 15:21:30 +01:00

zsh: update git_prune_branches

This commit is contained in:
bretello 2022-02-07 20:45:59 +01:00
parent c6b110b325
commit fc4972dab3
Signed by: brethil
GPG Key ID: 876AAC6290170FE7

View File

@ -230,9 +230,10 @@ function unzipd {
unzip -d "$name" "$zip_file"
}
# remove local branches which have been merged into master
# remove local branches which have been merged into master/main
function git_prune_branches(){
git branch --merged master | grep -v '^[ * ]*master$' | xargs git branch -d
local main=$(git_main_branch)
git branch --merged $main | grep -v '^[ * ]*'$main'$' | xargs git branch -d
}
fvim() {