I have a tag v1
set to an old commit. There is a bug with this version and I'd like to update it.
I ran get checkout v1
. I have updated the code to fix this bug, then git-added and git-commited.
Now I would like to update the tag v1
to reference this new commit.
I tried git push -f origin v1
. This does not work. I get the following response:
Everything up-to-date
Is there a way of achieving this? Preferably, I'd like to avoid creating a new branch, but if I have to, how can I avoid polluting the branch namespace? Can I just delete the branch afterwards?
I finally came up with a solution that works that doesn't require the creation of a new branch.
git checkout tag_name
Make local changes
git add .
and git commit -m "commit message"
git tag -fa tag_name
git push -f origin master --tags