Skip to content

Instantly share code, notes, and snippets.

@leongaban leongaban/git-prune
Created Feb 6, 2018

Embed
What would you like to do?
Prune local Git branches
# Replace REL_BRANCH with the appropriate name
git fetch --all --prune && git branch --merged | egrep -v "(^\*|REL_BRANCH|master)" | xargs -I % sh -c 'git branch -d %1; git push origin :%1;'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.