summaryrefslogtreecommitdiff
path: root/.local/bin/git-prune-merged-branches
blob: 772b4ad6353ca039c5b1aefaca91b134795db1a7 (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" HEAD; then
		echo "${ref#refs/heads/}"
	fi
done | xargs -r git branch -d