Git Cheat Sheet · Tags

Delete a tag

git tag -d <tag> · git push origin --delete <tag>

A tag is deleted separately locally and on the remote: git tag -d <tag> removes the local tag, git push origin --delete <tag> removes it from the remote.

What it does

Removes a tag locally, and separately on the remote.

A use case

You tagged the wrong commit.

On the command line

git tag -d v1.2.0
Deletes the local tag.
git push origin --delete v1.2.0
Deletes the tag on the remote.
git push origin :refs/tags/v1.2.0
Older syntax, equivalent.
git tag -a v1.2.0 <right-commit> && git push origin v1.2.0
Recreates the tag in the right place.

In Merathon

  1. "Tags" section, right-click the tag → "Delete" (local) or "Delete on <remote>".

Frequently asked questions

Does the deleted tag stay on my colleagues' machines?

Yes, their copy keeps it. They can remove it with git tag -d, or git fetch --prune --prune-tags.

See also