Created
September 5, 2017 18:13
-
-
Save artgillespie/b8eb19e5d5af0033d0e94b3812a4c80d to your computer and use it in GitHub Desktop.
Branch maintenance
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
# display the oldest 25 branches based on most recent commit date that start with `art` | |
git for-each-ref --sort=committerdate --format="%(refname:short)%09'%(committerdate)'" --count=25 refs/heads/art | |
# delete the oldest 25 branches based on most recent commit date that start with `art` | |
git for-each-ref --sort=committerdate --format="%(refname:short)%09'%(committerdate)'" --count=25 refs/heads/art | cut -f 1 | xargs git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment