Last active
June 23, 2018 18:58
-
-
Save jcf/f7014fe314e63c5552db to your computer and use it in GitHub Desktop.
Delete merged remote 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
# Assumes you want origin branches, ignoring `master`. | |
# Don't forget to to update your list of remote branches. | |
git remote prune origin | |
git branch -r --merged | \ | |
awk '/origin/ && ! /HEAD/ && !/master/ { split($0, x, "/"); print x[2] }' | \ | |
xargs -I x git push origin --delete x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Worked like a charm thanks 👍