How can I delete a remote tag?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
To delete a remote tag in Git, you need to follow these steps:
1. Delete the Tag Locally (Optional)
First, you can delete the tag locally using the git tag -d command. This step is optional, but it helps keep your local repository clean.
Replace <tagname> with the name of the tag you want to delete.
Example:
2. Delete the Tag from the Remote Repository
To delete the tag from the remote repository, you can use the git push command with the :refs/tags/<tagname> syntax.
Replace <tagname> with the name of the tag you want to delete.
Example:
- Explanation:
origin: The name of the remote repository. Replace this with your remote's name if it's different.:refs/tags/v1.0.0: The colon (:) beforerefs/tags/v1.0.0tells Git to delete the tag on the remote.
3. Verify the Deletion
You can verify that the tag has been deleted from the remote repository by running:
This command lists all tags in the remote repository, allowing you to confirm that the specified tag has been removed.
Summary
- Delete Locally:
git tag -d <tagname>(optional) - Delete Remotely:
git push origin :refs/tags/<tagname>
This process ensures that the tag is removed both locally (if you choose to) and from the remote repository.

