Delete all git branches but X and Y
<p>I've inherited a project that has over 800 branches, each having hundreds of commits and thousands of changes. The branches were created to isolate and fix small issues in the project, but weren't deleted afterwards.</p>

<p>Now trying to compare branches in GitHub takes forever, and deleting branches one by one is mind-numbing.</p>

<p>Can I tell git/github to delete all branches other than X, Y, Z so I keep only three?</p>