Created
December 31, 2020 05:19
-
-
Save arpitr/ac637bf2d530fbb77b9b72772f05d03c to your computer and use it in GitHub Desktop.
Delete merged branches from remote
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
// will skip deleting branches master|dev|stage | |
// replace origin with remote name | |
git branch -r --merged| egrep -v "(^\*|master|dev|stage)" | sed 's/origin\///' | xargs -n 1 git push --delete origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment