Mahmoud Zalt
Mahmoud Zalt

Reputation: 31190

How to delete Github Tag forever?

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?!

Upvotes: 12

Views: 8154

Answers (2)

Mahmoud Zalt
Mahmoud Zalt

Reputation: 31190

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.

Upvotes: 26

VonC
VonC

Reputation: 1327164

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.

Upvotes: 1

Related Questions