When you tag a commit, I know that you'll have the committer/author timestamp of the commit as well as a ctime/mtime/atime timestamp on the object file, but is there a separate recorded timestamp of when the tag was created/modified?
For example, when we tag a release, can we see the timestamp that the tag was added, or just the timestamps associated with the commit that the tag was added to?
It depends.
There are two kinds of tags:
Only annotated tags have a separate timestamp. They also have a tag message and record who made the tag ("tagger").
Annotated tags are created with
git tag -a -m "Release v1.0.1." v1.0.1
(If you do not give a tag message with -m
, an editor will open where you can supply the message.)
Annotated tags point to a tag object that points to the tagged object, usually a commit (HEAD
by default).
Simple tags are created with
git tag v1.0.1
These are simple refs that point to the commit directly without and intermediate tag object.
Both kinds of tags live in the refs/tags
hierarchy.