Removing local git branches that aren’t in the remote repository

New trick of the day. If you wanna cleanup your local git branches that were already merged, you could use this bash alias:

alias git_cleanup='git branch --merged develop | grep -Ev "(master|release|hotfix|develop)" | xargs git branch -d'

Props to Nick + Maxime!

%d