diff --git a/functions.zsh b/functions.zsh index c02ad00..63a8d5c 100755 --- a/functions.zsh +++ b/functions.zsh @@ -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() {