-
-
Save vsizov/4ff7c0b7c67be2cba0b1 to your computer and use it in GitHub Desktop.
Remove all remote and local branches except master and next
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
#!/bin/bash | |
git branch -d -r `git branch -r | awk '{ if ($0 !~ /next|master/) printf "%s", $0 }'` | |
git branch -D `git branch | awk '{ if ($0 !~ /next|master/) printf "%s", $0 }'` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment