diceline-chartmagnifiermouse-upquestion-marktwitter-whiteTwitter_Logo_Blue

How to update your local git tags with the remote tags

When someone deletes a git tag on a remote and then creates a new tag with the same name, git fetch or git pull can fail with this error:

 ! [rejected]          2.10.14    -> 2.10.14  (would clobber existing tag)

Git refuses to overwrite a local tag that points to a different commit than the remote tag.

The solution is to update your local tags with the remote tags. Force-fetch them:

git fetch --tags --force

--force (or -f) lets git replace the local tags that differ from the remote ones. Since Git 2.20, a plain git fetch --tags no longer updates existing tags, so you need the flag.