-
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 remove fetched, outdated branches:
git for-each-ref --format='%(refname:short) %(upstream)' refs/heads/ | awk '$2 !~/^refs\/remotes/' | xargs git branch -D
”
- Locally cleanup only merged branches:
Last active
April 12, 2022 03:29
-
-
Save una/7c0e69ca122a28921ecfed9665078d2a to your computer and use it in GitHub Desktop.
Cleanup Branches
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I might add...
Of course this is git, so there are variations on that^^ workflow. Like using
git branch --set-upstream-to && git pull
on master