0

I have attributed a tag called origin/v0.4.9 for a specific commit on a GitHub Pull Request. I thought the PR was simple, stable, and "a certainty" to be merged really fast. I was wrong.

I ended up extending the Pull Request - so the tag was kind of "deprecated" and stuck in the past. To make things worse, the PR was merged to main branch.

Now, I want to associate the same tag (which uses the project notation) to a different commit.

Locally, in Magit (via Emacs) I deleted it (ok), on GitHub I successfully deleted it, and I tried adding a tag with the same on another commit, the latest one. It worked out locally. But, I can't push the addition. The mini-buffer returns:

tag 'origin/v0.4.9' already exists

How do I fix this?

3
  • 1
    Force pushing commits to the main branch (when others also push to that branch) is a very bad practice. Can you see why?
    – aadcg
    Jan 2, 2023 at 8:35
  • 1
    Yeah... I will avoid doing that again. It can be especially dangerous if they pulled stuff and started working on it locally Jan 2, 2023 at 13:48
  • 1
    Actually it's worse than that. Say that you have pulled from the master branch and, in the meantime, someone else pushed to that same branch. By force pushing your changes, you're erasing possible changes that were pushed between the moment you pulled and the moment you force pushed.
    – aadcg
    Jan 2, 2023 at 14:20

1 Answer 1

0

For it to work out it was necessary to force push the tags!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.