GIT: [Rejected] (would clobber existing tag) Error

Viewed 6106

back story: We are using GitVersion during our build process to rename build with version numbers. We are also following the GitFlow process. We had a hotfix/2.9.1 branch that may have had another branch merged into it, thus causing GitVersion to go from 2.9.1 to 2.9.2. To fix this, we tagged the hotfix/2.9.1 branch with the tag 2.9.1. During this time work was being done on the hotfix branch. During the release we deleted the tag, merged hotfix/2.9.1 into master, then tagged master with 2.9.1. We then back-merged master into develop and our release branches.

We are now seeing issues in our builds:

enter image description here

I found this regarding tags and I am not sure if this would apply. I've tried deleting the tag locally as suggested here, I tried doing a git fetch --tags and pushing. This seems to only be happening on our build server (Azure).

Forgot to mention: If I delete the tag in Azure and re-queue a failed build everything works as expected.

2 Answers

Reason may be that you delete the original one tag, and created a same name again.

The solution:

git fetch --tags -f

Forced to refresh the local tag

From here

Related