Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Delete feature branch with prefix locally then remove all remote feature branches
# Stole from:
git branch -D $(printf "%s\n" $(git branch) | grep 'feature/')
# Or this will work too to remove all remote branches:
git branch -r | awk -F/ '/\/feature/{print $2}' | xargs -I {} git push origin :{}
# Prune all origin branches
git remote prune origin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment