So I was looking for a way to clean up the local branches in my repository because they seem to stack up after a few sprints.
I found a good short blog post which gave me the answer.
$ git branch | grep -v "master" | xargs git branch -D
Since we I don’t have the master branch locally and only the develop branch, I just changed it to:
$ git branch | grep -v "develop" | xargs git branch -D
Worked like a charm. Your local tree is now clean.
Photo from http://www.chesapeakequarterly.net/