Fast way to delete local git branches on cosole

When working on tickets I create a separate git branch for each ticket. That's great for organization, but the overview suffers after a while with way to many branches. I found a nice and fast way to remove all but the current branch for cleanup.

Just enter the following into your console:

$ for b in `git branch | grep -v \*`; do git branch -D $b; done