0

I have a Jenkins pipeline script. In it, I am calling Maven's release plugin like this:

mvn release:prepare

This under the hood does a git push and I am getting this error:

Unable to tag SCM
[ERROR] Provider message:
[ERROR] The git-tag command failed.
[ERROR] Command output:
[ERROR] fatal: tag 'my-project-1.3' already exists

However, when I list the Git's local tags:

git tag -l

and tags from origin:

git ls-remote --tags

nothing is shown.

So how come I can't see this tag when listing the Git tags but the push fails because of it?

bsky
  • 19,326
  • 49
  • 155
  • 270
  • have you pushed the tags? http://stackoverflow.com/questions/5480258/how-to-delete-a-git-remote-tag to check there is not a local one? – Essex Boy Mar 14 '17 at 15:47
  • Probably I pushed them, in which case `git ls-remote --tags` should show them, right? – bsky Mar 14 '17 at 15:49
  • Also, I tried deleting it with `git push delete origin my-project-1.3` and it's not shown. – bsky Mar 14 '17 at 15:53
  • Does `git fetch --tags` and then pushing the tag help? Also did you try forcing the push? – Naman Mar 14 '17 at 16:03
  • `git fetch --tags` doesn't return anything new. `git push --force --delete origin job-management-1.3` returns the same `error: unable to delete my-project-1.3: remote ref does not exist` – bsky Mar 14 '17 at 16:12
  • 2
    1. What is `job-management-1.3` in the above comment? 2. What I meant was to try something similar to `git push --force origin refs/tags/my-project-1.3:refs/tags/my-project-1.3` instead. – Naman Mar 14 '17 at 16:19
  • 1.I wrote that by accident. 2.`error: src refspec refs/tags/job-management-1.3 does not match any.` – bsky Mar 14 '17 at 16:59

0 Answers0