On Mar 11, 2:07 pm, vfclists <vfcli...@googlemail.com> wrote:

> Does tagging automatically create a commit, or does it apply to the
> latest commit?
There are two kinds of tags: simple tags and annotated tags.
Simple tag just names a commit while an annotated tag is a blob which
contains a message, references a commit it is attached to, and can be
signed.
In any case, neither of this kinds of tag creates a commit in the
sense of moving a branch tip.

Also tags can be attached to any object stored by Git, not only
commits, and when a tag is applied to a commit object, it can be any
commit object, not necessarily the tip of a branch.

For instance, you can put a "detached" file in the Git DB and tag it
to later access it by convenient name:
$ NAME=`git hash-object -w myfile.txt`
$ git tag myfile-tag $NAME
and then later you can do
$ git show myfile-tag >myfile.txt

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to