summaryrefslogtreecommitdiff
path: root/.local/bin/git-prune-pushed-branches
blob: e711560b95756867dc8aa47370405081046bb1a8 (plain)
1
2
3
4
5
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