Created
February 28, 2017 20:05
-
-
Save clamstew/f63f525a4f1b40c515ceffcb251c93b0 to your computer and use it in GitHub Desktop.
deletes all merged branches on git repo
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
git branch --remote --merged | | |
grep origin | | |
grep -v '>' | | |
grep -v master | | |
grep -v develop | | |
# grep -v <any-other-branch-name-you-want-to-keep> | | |
xargs -L1 | | |
cut -d"/" -f2- | | |
xargs git push origin --delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment