diff options
author | Luke Shumaker <lukeshu@datawire.io> | 2022-11-18 18:36:53 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@datawire.io> | 2022-11-18 18:36:53 -0700 |
commit | 9a62b4a64933f116b08e9e3cb06e013319610e4c (patch) | |
tree | 27bb1b131d5a0d35d34fa31e73f72b2446576dc8 /.local/bin/git-prune-pushed-branches | |
parent | 9adc8a2aeaf034f5172b32c9bd000c686465ab21 (diff) |
stuff
Diffstat (limited to '.local/bin/git-prune-pushed-branches')
-rwxr-xr-x | .local/bin/git-prune-pushed-branches | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/.local/bin/git-prune-pushed-branches b/.local/bin/git-prune-pushed-branches new file mode 100755 index 0000000..e711560 --- /dev/null +++ b/.local/bin/git-prune-pushed-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" "refs/remotes/origin/${ref#refs/heads/}"; then + echo "${ref#refs/heads/}" + fi +done | xargs -r git branch -D |