Created
October 6, 2021 14:17
-
-
Save lloesche/2f358685f95afc6bc0f1b773be12c081 to your computer and use it in GitHub Desktop.
Switch to main branch and delete all local git 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
git checkout $(git branch | grep -E "(main|master)" | sed -e 's/*\s\+//') && git branch | grep -vE "(main|master)" | xargs git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment