Remove local branches with the following commands.
yolo: deletes branches only if they have been fully merged into the upstream branch or currentHEAD.uber-yolo: deletes branches immediately, ignoring unmerged commits.⚠️
Add the following command to [alias] section in your global .gitconfig.
[alias]
yolo = "!git fetch -p && git branch --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -d"
uber-yolo = "!git fetch -p && git branch --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -D"
After saving you can use git yolo or git uber-yolo in your terminal of choice.