Below is a quick way to remove all git branches on your local machine, except for master. This is really helpful for those of us who commit new branches for each new task.
git branch | grep -v "master" | xargs git branch -D
This snippet was written by Adan Alvarado.