diff options
Diffstat (limited to '.local/bin/git-prune-merged-branches')
-rwxr-xr-x | .local/bin/git-prune-merged-branches | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/.local/bin/git-prune-merged-branches b/.local/bin/git-prune-merged-branches new file mode 100755 index 0000000..772b4ad --- /dev/null +++ b/.local/bin/git-prune-merged-branches @@ -0,0 +1,6 @@ +#!/bin/bash +git for-each-ref --format='%(refname)' refs/heads/ |while read -r ref; do + if git merge-base --is-ancestor "$ref" HEAD; then + echo "${ref#refs/heads/}" + fi +done | xargs -r git branch -d |