Created
September 14, 2021 10:04
-
-
Save braz/ef61902d12e75d8d5043e69020d2eb45 to your computer and use it in GitHub Desktop.
Cleanup local branches in Git no longer present remotely
This file contains hidden or 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
$ ~/.gitconfig | |
[alias] | |
janitor = !"git remote prune origin ; git branch -vv | grep ' gone]' | awk '{print $1}' | xargs git branch -D" | |
Run using | |
$ git janitor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment