Quick Tip: Deleting a Git Tag

When working with Git, there are a number of things that I find myself doing often enough that I assume I’m not the only one who has encountered the task.

So I thought I’d start a set of posts related to working with Git that may prove useful for anyone who’s also working with Git and who may be also encounter something similar.

These aren’t long posts. Instead, simple things that you can do that may help you with your work.

The only thing I want to note is that I don’t use a Git GUI. This does not mean they can’t work with a GUI (since you can use them simultaneously), but they are meant to be used on the command-line.

First: Deleting a Git Tag.

Deleting a Git Tag

If you’ve tagged something in Git, odds are you have the tag both on your local machine and most likely on the remote server. If it’s not been pushed yet, then it’s just on your local machine so you won’t need to follow everything below.

First, you may want to list all of the tags that you currently have. This can be done with the following:

Then you should see something like this:

Next, delete the local tag, delete the remote tag, and then push the changes (if the second change is necessary). For the purposes of this example, I’m using 0.1.0 as my tag name.

1. Delete the Local Tag

Deleting local tags is easy: Enter the following:

And that should take care of removing them from your local machine.

2. Delete the Remote Tag and Push the Changes

If you’ve pushed your tag to the remote machine, then you’ll need to also remove there, as well. This is as easy as doing the following:

This step is only necessary if your work resides on the server so I’m including it here for completeness.