Created
September 18, 2017 07:41
-
-
Save Smenus/18a9553ef98f28abccc78d7049f1dbc1 to your computer and use it in GitHub Desktop.
git-rename-tag
This file contains hidden or 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/sh | |
# I think this is run TAG="oldtag" NEWTAG="newtag" sh git-rename-tag.sh | |
# It should keep the same date, committer and message as the original tag | |
fmt=' | |
tagcommit=%(objectname) | |
tagname=%(taggername) | |
tagemail=%(taggeremail) | |
tagdate=%(taggerdate) | |
tagmessage=%(contents) | |
GIT_COMMITTER_DATE="$tagdate" GIT_COMMITTER_NAME="$tagname" GIT_COMMITTER_EMAIL="$tagemail" git tag -m "$tagmessage" "$NEWTAG" $tagcommit | |
git tag -d "$TAG" | |
' | |
eval=`git for-each-ref "refs/tags/$TAG" --shell --format="$fmt"` | |
eval "$eval" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment