Forked from leandrocrs/git_cleanup_non_remote_branches.sh
Created
July 14, 2022 02:37
-
-
Save darkterminal/55d8e2d7732daebd7b9daaca7b152f75 to your computer and use it in GitHub Desktop.
command to cleanup all local branch without remote
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git fetch --prune | git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment