Why should I care about lightweight vs. annotated tags?

前端 未结 9 1698
天命终不由人
天命终不由人 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 09:51

    Annotated tags store extra metadata such as author name, release notes, tag-message, and date as full objects in the Git database. All this data is important for a public release of your project.

    git tag -a v1.0.0

    Lightweight tags are the simplest way to add a tag to your git repository because they store only the hash of the commit they refer to. They can act like "bookmarks" to a commit, as such, they are great for private use.

    git tag v1.0.0

    You can sort, list, delete, show and edit old tags. All these functions will help you to identify specific release versions of your code. I found this article that could help you to get a better idea what tags can do.

提交回复
热议问题