Skip to content

How to delete Git tags

Covers
Git
Versions & support
About Git →

Tags work as an additional identifier for a particular incident. And in the case of Git, Tags are used as the reference points in your development workflow and it denotes special events like a new version release or new commit. You can create a new tag to give a reference for your newly launched version.

We use tags for future reference of our previous releases and commits. And we can create and delete as per our convenience.

  1. To delete a tag from a local repository, We can use the “git tag -d” command followed by the tag name you want to delete. For example:
    git tag -d [tagName]
    

    So if you want to delete a tag v1.4 then you can execute:

    git tag -d v1.4 
    
  2. To delete tags from the remote repository, Execute the following command:
    git push origin --delete origin [tagName] 
    
  3. You can also use the git push command to delete a tag by specifying the tag name by refs syntax.
    git push origin :refs/tags/[tagName] 
    
  4. If you want to check if your tags have been deleted or not then you can list them all using “-l”
    git tag -l 
    

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top