Git

How to Delete a Remote Git Tag

Git tags are used for marking out the particular point or condition (releases or bug-fixes related information) in the history of a project. Remote and Local are the two types of git tags, which means we can push the tags both locally and remotely. These tags help identify the important points of project history to identify and consider them in the future.

If you are a bit familiar with tags, you most probably come across the condition where you want to delete the git tags. So it is easy to delete both local and remote git tags in Linux, and if you also want to learn, please read this guide thoroughly.

For deleting the remote git tag, we use the -d or –delete command, so here is the basic git push command with –delete:

$git push --delete <origin-name><tag>

Once you execute the command, then the system will ask you to sign in to the website where the repository is stored.

Remember that whenever someone creates a clone of the repository, the system automatically clones the tags.

You can specify the tag name by the refs syntax for deleting the remote git tags using git push command:

git push <origin> :refs/tags/<tagName>

Once you execute the above command, then verify that the git tag is deleted or not, so run the following command for it:

git tag -l

Bonus Tip
In case you want to delete the local git tag, here are a few quick tips:

Deleting the local git tag is easy because these tags are stored in the local files, so you just need to execute the following command in the terminal:

git tag -d <tag-name>

Conclusion

This is the complete information about the git tags and how you can delete them both remotely and locally. The git tags are essential for finding bugs and glitches from the previous repository updates. However, once developers are done with the changes, they can delete the git tags. Make sure you use the command carefully because it can create issues if you delete a wrong git tag.

About the author

Prateek Jangid

A passionate Linux user for personal and professional reasons, always exploring what is new in the world of Linux and sharing with my readers.