Last active
February 20, 2018 08:36
-
-
Save kennyk/8104728b5d9be2b5fc33ca4688693ba3 to your computer and use it in GitHub Desktop.
Delete local copies of remote branches
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
Branches that are local only will not be touched. | |
Branches that have been deleted on remote but were not merged will show a notification but not be deleted on local. | |
If you want to delete those as well change `-d` to `-D`. | |
git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment