Removing local merged branches
In terminal, you can use:
git branch --merged | grep -v "\*" | grep -v master | grep -v develop | grep -v uat | xargs -n 1 git branch -d
To delete all local branches which have been merged, excluding in this case master
, develop
and uat
. Great for quick cleanups.