Skip to content

Instantly share code, notes, and snippets.

@pix-art
Last active December 21, 2016 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pix-art/eada3f45138b3cb65c0ea565e5cf90fd to your computer and use it in GitHub Desktop.
Save pix-art/eada3f45138b3cb65c0ea565e5cf90fd to your computer and use it in GitHub Desktop.
1. Create cleanup.sh somewhere with the following code:
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d
2. Create global alias for that file:
git config --global alias.cleanup '!sh <location of your file>/cleanup.sh'
3. Checkout to your develop or master and run:
git cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment