![]() Yes, tag objects can point to any other type of object like blobs, not just commits. As we can see from the output, the metadata fields are: Sample output: object 4284c41353e51a07e4ed4192ad2e9eaada9c059fĪnd this is how it contains extra metadata. ![]() git tag -as -m msg annotĬontains the SHA of the annotated tag object: c1d7720e99f9dd1d1c8aee625fd6ce09b3a81fefĪnd then we can get its content with: git cat-file -p c1d7720e99f9dd1d1c8aee625fd6ce09b3a81fef So no wonder they cannot contain any other metadata.Īnnotated tags point to a tag object in the object database. 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). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |