Created
February 11, 2020 12:56
-
-
Save njpearman/8e7487b794eba159751a5e3319eb19d0 to your computer and use it in GitHub Desktop.
Regenerate all tags with date set to that of the commit that was tagged
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
#!/bin/bash | |
# This script will regenerate every tag in a repository, setting the | |
# creation date of the tag to that of the commit that the tag is | |
# attached to. The message for the tag is set to the static string | |
# 'End of unit'. | |
git tag | while read tag; | |
do | |
git checkout ${tag} | |
git tag -d ${tag} | |
git push origin :refs/tags/${tag} | |
GIT_COMMITTER_DATE="$(git show --format=%aD | head -1)" git tag -m 'End of unit' ${tag} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment