Last active
March 4, 2024 17:16
-
-
Save szhu/3c427ba8ccd66e353307882ce3a91229 to your computer and use it in GitHub Desktop.
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
# This does a dry run; it prints out what should be run. You can then run it yourself. | |
for branch in (git branch --format "%(refname:short)") | |
set sha (git rev-parse $branch) | |
if git log -1 $branch --pretty=format:'%cr' | grep -q -E 'weeks|months' | |
set date (git log -1 $branch --pretty=format:'%cs') | |
echo | |
echo '#' $branch | |
echo git tag $date-$branch $sha | |
echo git branch -D $branch | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment