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

前端 未结 8 927
悲&欢浪女
悲&欢浪女 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条回答
  •  -上瘾入骨i
    2020-12-04 06:41

    It seems that I'm late on this issue and/or it has already been answered, but, what could be done is: (in my case, I had only one tag locally so.. I deleted the old tag and retagged it with:

    git tag -d v1.0
    git tag -a v1.0 -m "My commit message"
    

    Then:

    git push --tags -f
    

    That will update all tags on remote.

    Could be dangerous! Use at own risk.

提交回复
热议问题