Hacker News new | past | comments | ask | show | jobs | submit login

By default, most things assume that tags are immutable and won't check for updates to a tag. So tags aren't great for things that can expire or otherwise need to be changed.



Huh, is that true? If you push a new version of a tag, Github will ignore it? Or if you 'git fetch', git does not update tags? I would be pretty surprised at either of those.


All tag updates require a force push and any existing clones also need a force pull.


I agree. It is not the case that "most things ... won't check for updates to a tag," which is what GP claimed and I responded to. Most things do check for updates! Without checking, they could not warn you about / reject updates.


The trick to remember though is that new clones don't have any "update" check, they only see and fetch the latest value. There's no force push audit log for git refs in most git server software, there's just "local and remote refs disagree". That's not really an "update check" from the perspective of "having an update notification or update event".


It's the second one


I don't think so. In both cases, there was visible UI of either the new tag or that the tag was changed.

Github shows the updated tag.

git pull --tags shows:

  ! [rejected]        <tag>   -> <tag>  (would clobber existing tag)
git pull --tags --force updates the tag.


You asked about `git fetch`. If you change your question to `git pull --tags` then yes, the answer is different.


git fetch --tags presents the exact same warning/error.


That's right.

> if you 'git fetch', git does not update tags? I would be pretty surprised

This is the comment you replied to:

> By default, most things assume that tags are immutable and won't check for updates to a tag.

You can use options to change from the default. I don't know what point you are now trying to make, but this conversation is getting very laborious.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: