In Git Bash/ Git CLI run the commands as follow (from whichever branch you are currently on):
git remote prune origin
Then:
- checkout master
- update it
and run in Git Bash/ Git CLI:
$ git branch --merged | grep -v "\*" | xargs -n 1 git branch -
And that's it!
To delete all local branches except master:
$ git branch | grep -v "master" | xargs git branch -D
Some commands to a further clean up: Git clean
Top comments (0)