Last active
February 10, 2021 13:25
-
-
Save cedriclombardot/2871347 to your computer and use it in GitHub Desktop.
Delete git merged branch with confirmation
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
# List dist branch merged | exclude master, HEAD and develop | remove origin/ | delete remote branch asking confirmation | |
git branch -r --merged | grep -vw "master" | grep -vw "HEAD" | grep -vw "develop" | sed -e "s/origin\///g" | sed -e 's/^[[:space:]]*//' | xargs -p -I {} git push origin :{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage :