This adds a command so you can run git delimb
and it will remove local branches that have been merged in and are no longer of use. Often this is more efficient than running git fetch --prune
. It also protects master
and dev
branches.
git config -e --global
Note: This will check against the current branch you're on.
[alias]
delimb = "!git branch --merged | grep -v '\\*\\|master\\|develop' | xargs -n 1 git branch -d"