From 9a62b4a64933f116b08e9e3cb06e013319610e4c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 18 Nov 2022 18:36:53 -0700 Subject: stuff --- .local/bin/git-prune-pushed-branches | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 .local/bin/git-prune-pushed-branches (limited to '.local/bin/git-prune-pushed-branches') 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 -- cgit v1.2.3-2-g168b