Last active
May 11, 2020 09:31
-
-
Save Maybach91/37e838a5d6324395de2e752c013f148e to your computer and use it in GitHub Desktop.
Remove MERGED local Branches without Remote https://stackoverflow.com/a/33548037/1468576 #git #branch #gitflow #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
// https://stackoverflow.com/a/59912825/1468576 | |
git fetch -p && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D |
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
// https://stackoverflow.com/a/33548037/1468576 | |
git fetch -p && for branch in `git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'`; do git branch -D $branch; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment