The following commands were tested in MacOS. Not yet in Linux.
Delete all local branches except master, development and the current branch (in this example). You can add as many branches as you want in the regex.
cd into-the-desired-repo
git branch | egrep -v "(master|development|\*)" | xargs git branch -D
Delete all remote (origin) branches except master, development and the current branch (in this example). You can add as many branches as you want in the regex.
cd into-the-desired-repo
git branch -r | grep origin/ | egrep -v "(master|development|\*)" | grep -v HEAD | cut -d/ -f2- | while read line; do git push origin :$line; done
cd into-the-desired-repo
git tag -d $(git tag -l)
cd into-the-desired-repo
git push origin --delete $(git tag -l)