How do I delete stale git branches?

We had over 100 branches that needed to be deleted. Here is the script.

You can open the output in Excel and add some formatting on the keywords month and year if you want to share the output file around. Otherwise just run it!

PS: Extra points if you name the file git-remove-branches and put in %HOME/bin. You can then do “git remove-branches” in whatever repo you are.