We're currently cleaning up our git repo at work due to a ridiculous amount of branches and tags that just aren't needed.
We've done the branches part, but the tags part is proving troublesome.
We deleted the branches on the remote, and asked our team to do a git pull --prune
to remove said branches in their local repos.
The problem is, there doesn't seem to be a way to do this with tags. We can delete the tag remotely quite easily, but we can't get that change to propagate down to other local repos when we do a git pull
, or gc
, or remote prune
.
Any ideas on how to do this?
Or will we just have to stop people from using git push --tags
until they re-clone the repo?
To delete a local git tag simply run the "git tag" command with the -d option and tag name. To know the tag name you can run the "git tag" command with the -l option to list all tags, identify the tag you want to delete.
nothing. It will remain there, pointing to an invalid reference, until you remove it with git tag -d <tag> .
Click on the tag in the example page or email. From the pop-up menu that displays after you click the tag, select Clear tag.
You can't. Tags deleted on the remote will not be locally deleted on pull
/fetch
/etc.
In older versions of Git this seems to work fine:
git fetch --tags --prune
(But this no longer works as of Git version 1.9.0 or newer.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With