There is the old and quite popular question How do I edit an existing tag message in git?. So far, it attracted 10 (+2 deleted) answers.
- The good thing is: The currently accepted and most upvoted answer seems to be correct.
- The bad thing is: The accepted answer has only "recently" been edited (in 2018). Before the edit, the answer was not correct, provoking several competing answers that point out that the accepted answer is incorrect and suggest better solutions. These solutions however are exactly what the edited accepted answer proposes.
Overall, this leads to a lot of confusing and potentially misleading information due to the (now obsolete) claims that the accepted answer was wrong.
Is there anything we can do about this? Rolling back the edit that fixed the accepted answer seems like a very bad idea. On the other hand, with the edited accepted answer the answers by Eric Hu, Sungam, stanm and liuyang1 are (mostly) obsolete.
Background:
- The accepted answer by Andy originally suggested
git tag <tag name> <tag name> -f -m "<new message>"
. This has been changed togit tag <tag name> <tag name>^{} -f -m "<new message>"
in 2018 (note the^{}
). - In 2013, Eric Hu suggested
git tag <tag name> <tag name> -f -a
. Much later (2019) this answer has also been edited togit tag <tag name> <tag name>^{} -f -a
. - Sungam's answer seems to be the first that proposed
git tag <tag name> <tag name>^{} -f -a
, stating that this is an "improvement". - stanm's answer discusses the shortcomings of the (original revisions) of the first two answers and provides an alternative to Sungam's answer.
- liuyang1's answer explains that the accepted answer is wrong – but this refers to the original revision.
Overall, this is a big mess. I think in an ideal world Shungam's answer would be accepted and upvoted. Then the edits to Andy's and Eric Hu's answers could be rolled back and everything would be consistent. But given the very "nonlinear history" of this Q&A I am not sure how it can be cleaned up.