summaryrefslogtreecommitdiff
path: root/.local/bin/git-prune-merged-branches
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@datawire.io>2022-11-18 18:36:53 -0700
committerLuke Shumaker <lukeshu@datawire.io>2022-11-18 18:36:53 -0700
commit9a62b4a64933f116b08e9e3cb06e013319610e4c (patch)
tree27bb1b131d5a0d35d34fa31e73f72b2446576dc8 /.local/bin/git-prune-merged-branches
parent9adc8a2aeaf034f5172b32c9bd000c686465ab21 (diff)
stuff
Diffstat (limited to '.local/bin/git-prune-merged-branches')
-rwxr-xr-x.local/bin/git-prune-merged-branches6
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