11

I know I can go to github.com, select my tag and then click delete, but this will only delete the Tag information not the actual Tag. So how to delete it forever?!

Mahmoud Zalt
  • 30,478
  • 7
  • 87
  • 83

2 Answers2

24

Run this in your local git repository:

git fetch
git tag
git tag -d {tag-name}
git push origin :refs/tags/{tag-name}

Visit Github.com and refresh to see the tags have been removed.

FullByte
  • 149
  • 1
  • 2
  • 12
Mahmoud Zalt
  • 30,478
  • 7
  • 87
  • 83
1

Mahmoud's answer is confirmed by:

Releases are also lightweight Git tags, with some extra awesome features to help you release software.

So On GitHub side, you don't actually delete an annotated tag, only a lightweight one.
Pushing an empty reference to a GitHub tag will actually delete it from the GitHub repo.

choroba
  • 231,213
  • 25
  • 204
  • 289
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250