-
Go to the remote repo and delete outdated branches
-
Then either:
- Locally cleanup only merged branches:
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
- Locally cleanup only merged branches:
- Locally remove fetched, outdated branches:
git for-each-ref --format='%(refname:short) %(upstream)' refs/heads/ | awk '$2 !~/^refs\/remotes/' | xargs git branch -D
”