gitsemaphore-ci

how to fix the would clobber existing tag problem


I've got myself into trouble with git tagging and now my build pipeline (semaphore) is broken with the following error message. Not sure how to get this resolved.

Error message

Unpacking 
objects: 100% (32/32), done.
From github.com:jack/my-app
   c8a2420..75ea515  develop         -> origin/develop
   b4069ce..9f672e1  feature/RY-1144 -> origin/feature/RY-1144
   8dbf387..ac9db9d  master          -> origin/master
 ! [rejected]        v1.46.0         -> v1.46.0  (would clobber existing tag)
 * [new tag]         v1.47.0         -> v1.47.0

Update

I'm using visual code with some extensions and looking at the history of repo within visual code it looks like the tag can be deleted? If I click on the 'x' next to the tag 'v1.46.0' and then commit and push (with follow follow-tags) will this resolve my problem?

git history


Solution

  • The cause is : tag v1.46.0 on your remote does not point at the same commit as tag v1.46.0 on the local clone (local to your CI server).


    a. Check that the v1.46.0 tag points at the right commit on the remote server (update it manually if needed),

    b. Force update the tag(s) on the CI server by running one of the following two commands :

    # to force update all tags :
    git fetch --tags --force
    
    # to force update only this specific tag :
    git fetch origin -f v1.46.0:refs/tags/v1.46.0