What is the annotated tag object, and how does it differ from the other Git object types?
Last updated
The annotated tag object is one of Git's four object types (with blob, tree, commit): an immutable object referencing a target (usually a commit) plus tag name, tagger, date, message, and optional signature.
Unlike blobs (file content), trees (directories), and commits (snapshot plus parents), it adds no file data and only annotates another object.
Resolution takes two hops:
refs/tags/v1.0points to the tag object, which points to the commit. Inspect it withgit cat-file -p v1.0.
- https://topnotchnote.com/version_control/internals
- https://git-scm.com/book/ms/v2/Git-Internals-Git-References
- https://www.adityathebe.com/git-objects/
- https://git-scm.com/docs/git-tag
- https://git-scm.com/docs/gitdatamodel
- https://www.boot.dev/blog/devops/git-internals
- https://dev.to/__whyd_rf/a-deep-dive-into-git-internals-blobs-trees-and-commits-1doc
- https://medium.com/@aydanabbasli/git-has-four-moving-parts-a5f110affd74