Search code examples
gittagsremoveall

How to remove all git origin and local tags?


How do you remove a git tag that has already been pushed? Delete all git remote (origin) tags and Delete all git local tags.


Solution

    1. Delete All local tags. (Optional Recommended)
      # Clears out all your local 
      git tag -d $(git tag -l)
      
    2. Fetch remote All tags. (Optional Recommended)
      # All remote tags give you a complete list of remote tags locally
      git fetch
      
    3. Delete All remote tags.
      # Note: pushing once should be faster than multiple times
      # Deletes the remote tags concerning the local
      git push origin --delete $(git tag -l) 
      
    4. Delete All local tags.
      # Deletes the local tags after fetch 
      git tag -d $(git tag -l)