Skip to content

Instantly share code, notes, and snippets.

@szhu
Last active March 4, 2024 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szhu/3c427ba8ccd66e353307882ce3a91229 to your computer and use it in GitHub Desktop.
Save szhu/3c427ba8ccd66e353307882ce3a91229 to your computer and use it in GitHub Desktop.
# 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