Git: how to remove a wrong tag

Git: how to remove a wrong tag.

git: how to remove a wrong tag

This post is nothing special, I know, but it’s a very useful reminder to me. Thus, if you need to delete a wrong tag on any remote before pushing it:

git push origin :refs/tags/<tagname>

Then you can do whatever you want, adding more local commits and doing some work. Then, if you want to tag a new software version referencing to the most recent commit:

git tag -fa <tagname>

And then, push your local history:

git push origin master --tags

That’s all! #gwh

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

About Francesco Serafin

I am a PhD student at the Department of Civil, Environmental and Mechanical Engineering at the University of Trento. My two greatest loves: Computer Science and Water (take three with my Lenovo!:D). As a result, the aim of my life is to make both passions coexist. My gpg public key available at https://pgp.mit.edu

Leave a Reply

Your email address will not be published.

*