How to Delete Remote Git Tags
Reading the following tutorial you will get familiar with tagging in general, the usage of the git tag command, and two ways of removing the remote tag.
Tags are references that show particular points in Git history. The primary function of tagging is to capture a point in a Git history that marks version release.
While creating a tag, typos can be made and force you to delete it. Here, we are going to show you how to remove remote tags.
Deleting a remote Git tag
To delete a remote git tag, use the following command and specify the tag name (suppose, the name of remote is origin, which is by default):
delete remote tags git
git push --delete origin <tag-name>As you can see, the command for deleting a branch and a tag is the same, so, in case of having a branch and a tag with the same name, you should use the refs syntax to specify that you want to delete exactly the tag:
delete remote tag
git push origin :refs/tags/<tag-name>Describing Git Tags
<kbd class="highlighted">Git tags</kbd> allow tagging specific points in the history of repository and return to them later. Tags point directly to specific commits in the history. There are two kinds of tags supported by Git: annotated and lightweight tags. The difference between them is the amount of metadata they store. Both tag types are visible to anyone with access to the repository.
Git Push Origin and Git Push
The git push command implicitly pushes your work to a remote repository. By default, that remote repository is the origin. The <kbd class="highlighted">git push</kbd> origin explicitly specifies to be pushed into a repository called origin.
The <kbd class="highlighted">git push</kbd> origin is usually used only when there are multiple remote repositories, and you want to define which remote repository should be used for the push.