github-logo

Adding and Removing Tags on GitHub

Posted

If you’ve accidentally committed a tag and pushed it up to GitHub, it’s quite easy to delete it and then add a new one. For this example, I’m deleting my previous tag “v1.0″, and then adding a new one for the repo at its current state.

1) Delete the v1.0 tag locally: git tag -d v1.0
2) Delete the v1.0 tag on GitHub (which removes its download link): git push origin :v0.4
3) Add a new tag for the updated release: git tag -a v1.0 -m "Version 1.0 Stable"
4) Push the latest tag to GitHub (two dashes): git push --tags

About Devin

I'm a WordPress developer based in Austin, Texas. Follow my projects on GitHub, or more general WordPress ramblings as @devinsays on twitter.

5 thoughts on “Adding and Removing Tags on GitHub

  1. Trent wrote:

    Thanks for this, helped out a lot.

  2. Ben wrote:

    Ha! Just found a use for this, thanks! (I accidently tagged a repo before committing some changes, so the tagged version wasn’t correct. Just deleted and then re-tagged it – quite handy!)

    • erikb85 wrote:

      Doesn’t matter. Both means the same.

      • Ben Carter wrote:

        Not really the same one infers a link to some reference by that name be it a branch or tag. If you have a branch and tag with the same name it will not work.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>