Created
May 19, 2020 18:03
-
-
Save alexisdiel/32041c70968245ffaff26f0e77a98a79 to your computer and use it in GitHub Desktop.
Git delete all merged 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
LOCAL BRANCHES (git rmlocal) | |
git config --global alias.rmlocal 'git branch --merged | egrep -v "(^\*|master|prod)" | xargs git branch -d' | |
REMOTE BRANCHES (git rmremote) | |
git config --global alias.rmremote 'git branch -r --merged | egrep -v "(^\*|master|prod)" | sed "s/origin\///" | xargs -n 1 git branch -d origin' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment