尝试通过源树推送时,出现以下错误:
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags origin refs/heads/master:refs/heads/master Pushing to https://user@github.com/repo.git To https://user@github.com/repo.git = [up to date] master -> master ... ! [rejected] example_tag -> example_tag (already exists) updating local tracking ref 'refs/remotes/origin/master' error: failed to push some refs to 'https://user@github.com/repo.git' hint: Updates were rejected because the tag already exists in the remote. Completed with errors, see above
据我所知,我没有对此标签进行任何更改。我怎样才能解决这个问题?
如果您没有对要保留的标签进行任何本地更改,那么您可以 删除因为 已经存在 而被拒绝的标签(example_tag在这种情况下):
example_tag
这在 SourceTree 中很常见的原因是 Push all tags 选项默认设置为 on 。(隐藏此错误的另一种方法是取消选中该选项。)