Specifically, while retaining the tag's annotation message and date.
Last night, I created a signed tag for a repo I'm working on. A few minutes later, I unthinkingly amended the commit I'd tagged. Now, I'm getting ready to push my changes and need to clean up that tag before I do.
Looking at a similar (ish) question, I've attempted various combinations of GIT_AUTHOR_DATE
and GIT_COMMITER_DATE
with no luck:
$ git show v0.1.1 | awk '{ if ($1 == "Date:") { print substr($0, index($0, $3)) } }'
Nov 26 18:14:17 2017 -0800
Nov 26 18:13:21 2017 -0800
$ git tag -d v0.1.1
Deleted tag 'v0.1.1' (was d4189a2)
$ GIT_AUTHOR_DATE="Nov 26 18:14:17 2017 -0800" \
> GIT_COMMITER_DATE="Nov 26 18:14:17 2017 -0800" \
> git tag v0.1.1 9aa951c -s -m 'Display in columns.'
$ git show v0.1.1 | awk '{ if ($1 == "Date:") { print substr($0, index($0, $3)) } }'
Nov 27 13:34:16 2017 -0800
Nov 26 21:18:34 2017 -0800
How can I "fix" this tag?