// clean up local branches
git branch -d $(git branch --merged=main | grep -v main)
or
git branch -d $(git branch --merged=main | git branch --merged=develop | grep -v main | grep -v develop)
// clean up not merged branches
git branch -D $(git branch --no-merged)
// clean up remote branches
git fetch -p