“tag already exists in the remote" error after recreating the git tag

前端 未结 8 933
悲&欢浪女
悲&欢浪女 2020-12-04 06:00

I get the following error after I run the steps below:

To git@provider.com:username/repo-name.git
 ! [rejected]        dev -> dev (already exists)
error:          


        
8条回答
  •  既然无缘
    2020-12-04 06:36

    Some good answers here. Especially the one by @torek. I thought I'd add this work-around with a little explanation for those in a rush.

    To summarize, what happens is that when you move a tag locally, it changes the tag from a non-Null commit value to a different value. However, because git (as a default behavior) doesn't allow changing non-Null remote tags, you can't push the change.

    The work-around is to delete the tag (and tick remove all remotes). Then create the same tag and push.

提交回复
热议问题