git/refs/tags that contains a SHA-1įor lightweight tags, the SHA-1 points directly to a commit: git tag light git describe without command line options only sees annotated tagsīoth lightweight and annotated tags are a file under.git push -follow-tags will only push annotated tags. Lightweight tags don't have that extra information, and don't need it, since you are only going to use it yourself to develop. So you could use them to describe a release without making a release commit. Push annotated tags, keep lightweight localĪnnotated tags are meant for release while lightweight tags are meant for private or temporary object labels.Īnd certain behaviors do differentiate between them in ways that this recommendation is useful e.g.:Īnnotated tags can contain a message, creator, and date different than the commit they point to. When you use git tag -m, Git will behave as if you passed the -a flag for annotation and use the provided message.īasically, it just amounts to whether you want the tag to have an annotation and some other information associated with it or not.When you use git tag -a -m, Git will tag the commit and annotate it with the provided message.When you use git tag -a, Git will prompt you for an annotation unless you have also used the -m flag to provide a message.It will be tagged without a message (this is a lightweight tag). When you use git tag, Git will create a tag at the current revision but will not prompt you for an annotation.There are also some different options to write a message on annotated tags: More About Lightweight TagsĪccording to the documentation: "To create a lightweight tag, don’t supply any of the -a, -s, or -m options, just provide a tag name". An annotated tag has a message that can be displayed with git-show(1), while a tag without annotations is just a named pointer to a commit. The difference between the commands is that one provides you with a tag message while the other doesn't.
0 Comments
Leave a Reply. |