Skip to content

Instantly share code, notes, and snippets.

@d4nidev d4nidev/git-clean.sh
Last active Feb 27, 2019

Embed
What would you like to do?
Removes all local branches in a git repository which are already merged or deleted from origin.
git fetch -p && for branch in `git branch -vv --no-color | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done
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.