-
-
Save jonathanlarsen/4732175 to your computer and use it in GitHub Desktop.
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
Delete remote merged into master | |
git branch -r --merged | awk -F'/' '/^ *origin/{if(!match($0, /(>|master)/)){print $2}}' | xargs git push origin --delete | |
Delete local merged into current branch | |
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d | |
Delete all remote not in egrep | |
git branch -a | egrep "remotes/origin/" | cut -d "/" -f 3- | egrep -v "(master|develop)" | xargs -n 1 git push --delete origin | |
Delete all local not in egrep | |
git branch | egrep -v "(master|develop)" | xargs git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment