Kendzi
Kendzi

Reputation: 106

How to overwrite tags in local git repository?

I have local clone of git repository where I created new tag. I didn't push that tag to remote repository. I would like to revert local list of tags to match remote. How can I achieve that?

I have check solution from How to overwrite local tags with git fetch? but without any success.

Upvotes: 3

Views: 1205

Answers (2)

larsks
larsks

Reputation: 311506

Just delete the local tag(s):

git tag -d <tag>

And then re-fetch tags from the remote:

git fetch --tags

If you want to delete all your local tags:

git tag | xargs -n1 git tag -d

Upvotes: 5

Paul Hicks
Paul Hicks

Reputation: 13999

I read in git help tag that git tag -d does what you want.

Upvotes: 0

Related Questions