Reputation: 5968
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?
Upvotes: 0
Views: 1974
Reputation: 5968
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
Upvotes: 0
Reputation: 1961
A tag is usually used for seeing the files at a specific version and the files is not meant to be changed once it is tagged, for example version 1.0 if you want to make changes and retag afterwards,
Upvotes: 1