Git - Deleting Merged Branches
I use git for source control when writing these posts. Eventually- my local editor ends up with 50 branches which have already been merged into origin/main, and I end up needing to manually go through and remove the old branches.
This, is a VERY short post, detailing how to create a git alias to automatically prune branches, which have been merged, or deleted on your remote.
If- you don't need steps on how to create the alias, then here is the command:
!git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D
Otherwise, keep reading.