Skip to content

Instantly share code, notes, and snippets.

@rollick
Created September 11, 2012 03:19
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 rollick/3695704 to your computer and use it in GitHub Desktop.
Save rollick/3695704 to your computer and use it in GitHub Desktop.
Remove branches already in master
git checkout master
git fetch
git remote prune origin
git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
cut -c8- |
xargs git push origin --delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment