“Updates were rejected because the tag already exists” when attempting to push in SourceTree

前端 未结 7 747
傲寒
傲寒 2021-01-29 23:10

When attempting to Push via Source Tree, I get the following error:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push         


        
7条回答
  •  我在风中等你
    2021-01-29 23:42

    If you have not made any local changes to the tag that you want to keep, then you can remove tag that was rejected because it already exists (example_tag in this case):

    1. Right-click the tag and choose to delete it (be sure to uncheck the Remove tag from all remotes checkbox).
    2. Choose the Fetch option (Fetch and store all tags locally does not have to be enabled).
    3. You should now have that tag that was just deleted back, and attempting to Push will no longer show that error message.

    The reason this is common in SourceTree is because the Push all tags option is set to on by default. (Another way to hide this error is to uncheck that option.)

提交回复
热议问题