Why should I care about lightweight vs. annotated tags?

前端 未结 9 1706
天命终不由人
天命终不由人 2020-11-27 09:29

I switched from Subversion to Git as my day-to-day VCS last year and am still trying to grasp the finer points of \"Git-think\".

The one which has been bothering me

9条回答
  •  不知归路
    2020-11-27 09:40

    I've found the one good use for lightweight tags - creating a release at GitHub in retrospective.

    We did release our software and we had the necessary commits, we just didn't bother to maintain the 'Release' section on the GitHub. And when we gave that a little attention, we've realised that we would want to add some previous releases too, with correct old release dates for them.

    If we would just create an annotated tag on an old commit, GitHub would take the date for the release from the tag object. In contrast, when we've created a lightweight tag for this old commit, the release started showing the correct (old) date. Source @ GitHub help, 'About releases'

    It seems it's also possible to specify your desired date for an annotated commit, but it doesn't look that simple to me: https://www.kernel.org/pub/software/scm/git/docs/git-tag.html#_on_backdating_tags

提交回复
热议问题