Git Sweep is a command line tool for cleaning up stale local branches in a Git repository. Git Sweep finds all local branches that don't have an associated remote, and deletes them if approved.
brew install edahlseng/core/git-sweep
Optional:
It's recommended to add an alias to your Git config:
[alias]
sweep = git-sweep
Inside of a Git repository, run git sweep
and follow the prompts. (Note: If a Git alias was not created during installation, then git-sweep
will need to be run instead.)