最佳答案
在运行以下步骤之后,我得到以下错误:
To git@provider.com:username/repo-name.git
! [rejected] dev -> dev (already exists)
error: failed to push some refs to 'git@provider.com:username/repo-name.git'
hint: Updates were rejected because the tag already exists in the remote.
dev
: git tag dev
git push --tags
删除标签 dev
,再次创建并推送标签:
git tag -d dev
git tag dev
git push --tags
Why is this happening?
I am on Mac. My friends that use Linux (Ubuntu) don't have this problem. I know that I can use git push --tags -f
to force the tag update, but this is dangerous (e.g. rewriting a commit made by mistake only in the tag, not in the branch).