mirror of
https://github.com/tj/git-extras.git
synced 2026-09-14 17:36:25 -04:00
9 lines
295 B
Bash
Executable file
9 lines
295 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
default_branch=$(git_extra_default_branch)
|
|
branches=$(git branch --no-color --merged | grep -vE "^(\*|\+)" | sed 's/^[ ]*//' | grep -Fvx -e "$default_branch" -e "main" -e "master" -e "trunk" -e "svn")
|
|
if [ -n "$branches" ]
|
|
then
|
|
echo "$branches" | xargs git branch -d
|
|
fi
|