jim smith
jim smith

Reputation: 2454

Git tag - why is this happening now?

My tags have stopped updating, pretty sure I'm not doing anything different from before. Anybody know how to resolve this?

$ git tag
v1.0.2
v1.0.3
v1.0.4
v1.0.5
v1.0.6
v1.0.7
v1.0.8
v1.0.9

$ git tag v1.1.0

$ git push --tags
 * [new tag]         v1.1.0 -> v1.1.0

What I expect is

* [new tag]         v1.0.9 -> v1.1.0

Note git push origin v1.1.0 does the same thing

Upvotes: 0

Views: 67

Answers (1)

Lasse V. Karlsen
Lasse V. Karlsen

Reputation: 391276

There shouldn't be anything to resolve because nothing looks wrong.

When you create a tag, in reality all you're doing is creating a label, a post-it note, putting a name on this label, and attaches it to a specific commit.

git tag v1.1.0

does this, and since you didn't specify what to tag, it tags the current commit, whatever commit HEAD is currently pointing to.

Then, when you do this:

git push --tags

and git responds with:

 * [new tag]         v1.1.0 -> v1.1.0

It basically says this:

 * [new tag]         v1.1.0 -> v1.1.0
   ^---+---^         ^--+-^    ^--+-^
       |                |         |
       |                |         +-- this is what the tag is now named on the server
       |                +-- this is what your tag is named locally (the one you made)
       +-- this is the server telling you that you gave it a new tag

So there is nothing wrong here. You created a new tag. You pushed your new, local, tag to the server, which responded by saying "You gave me a new tag".


In your comment you say "Composer won't update the package", which sounds to me like you're using those tags to label your software as well. That's OK, but it's not a git problem if those versions are out of sync with your git repository. If the package, that you now upped to v1.1.0, doesn't update in some software, you should check the reference in that software. Perhaps it is restricted in which version it can use? Did you publish your package correctly?

Upvotes: 2

Related Questions