Created
January 3, 2018 16:16
-
-
Save mattscilipoti/bd357b2413b1d0213afe95be5c4dc2a6 to your computer and use it in GitHub Desktop.
git: clean up local branches that have been deleted remotely
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
# 1. saves possible branches to file, opens in editor | |
# 2. remove branches you don't want to delete from the list and save. | |
git fetch --prune && git branch --no-color --merged | egrep -v "(^\*|master)" > /tmp/merged-branches && vi /tmp/merged-branches && xargs git branch -d < /tmp/merged-branches |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment