Git tags are shown, although I removed them

I removed some tags by doing:

  • git tag -d TAGNAME
  • git push origin :refs/tags/TAGNAME

After that, I asked all team members to run:

  • git tag -d $(git tag) - remove all local tags
  • git fetch --tags - to retrieve the current tags from a remote device.

The problem is that from time to time I see old tags again. I suspect that someone still has some old tags and they didn’t delete them or pull them out before I deleted them or so.

Is there a way to completely remove the tag?

For example, to make a commit that removes old tags, and therefore, before users can click, they will have to pull out this message and thus change their tags. Is it possible?

+6
source share
1 answer

When deleting remote branches, you must git remote prune origin to completely remove these remote branches from the working copy.

Since the tags are almost the same as the branches, I assume you need to trim too.

git fetch also knows the --prune , so either

 git remote prune origin 

or

 git fetch --prune 

gotta do the trick.

This is an additional security measure: fetch only updates known remote branches and introduces new ones, but does not delete them unless --prune requested.

+4
source

All Articles