Created
December 14, 2023 16:54
-
-
Save dharness/21144563c9820b2cc6d1b19b8729cd6d to your computer and use it in GitHub Desktop.
Delete git branches more than 2 weeks old
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
git for-each-ref --sort=-committerdate refs/heads --format='%(committerdate:short) %(refname:short)' | awk '$1 < "'$(date -v-2w +%Y-%m-%d)'" {print $2}' | xargs git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment