corptaya.blogg.se

Git tag show
Git tag show







git tag show

In this article, we provided a detailed overview of annotated tags in Git. The annotation message itself, in this case This is version 3.0.the user who created the tag and tag time The type of object that the tag points to, in this case commit.The object ID of the commit that the tag points to (in this case 051ef0038ca3d8273bb6750ccf07c624821f9c4d).This shows that annotated tags store the following information: We can verify that this is a tag object using the git cat-file command along with the -t flag: $ git cat-file -t bd0bf094154490236f7fb7d4d48c105151631fa1įurthermore, we can see the actual tag's storage format and content using git cat-file again but with the -p flag: $ git cat-file -p bd0bf094154490236f7fb7d4d48c105151631fa1 To get the SHA-1 hash value of the annotated tag itself, you can use the git rev-parse command along with the tag name: $ git rev-parse v3.0 This means that each annotated tag content is hashed, compressed, and stored in the object database like any other Git object. You can list an annotated tag message by using the git tag command along with the tags name and the -n flag: $ git tag v3.0 -nĪs previously mentioned, since annotated tags contain a custom message that can't simply be stored as a ref filename, Git will actually create a new object for each tag in the Git repository. Note that using the -m flag implies that this will be an annotated tag, so you don't need to include the -a flag in this case. If you want to specify the annotated tag message directly on the command line, you can use the -m flag exactly like you do for a commit message: $ git tag v3.0 -m "This is version 3.0" So for this tag you can enter something like This is version 2.0. This will name the tag v2.0 (just like a lightweight tag), but in addition Git will open your default text editor for you to enter the annotation message, similar to how it works for commit messages without the -m flag. Create an annotated tag in GitĪnnotated tags are created by simply adding the -a flag to the git tag command: $ git tag v2.0 -a

#Git tag show free

git/refs/tags/v1.0.įeel free to test this out and open the newly created ref file v1.0 to see that it just contains the commmit ID that it refers to. Lightweight tags are the default type of tag created when you run git tag like: $ git tag v1.0Īs mentioned, this just creates a new tag ref file here. You're probably familiar with creating lightweight tags in Git. Since annotated tags actually store user-generated content besides the tag name, Git actually formats it into an object, hashes it, and stores it in the object database. On the other hand, annotated tags store an additional message - or annotation - in addition to the actual tag name. Well, the difference is that's all there is for lightweight Git tags. git/refs/tags folder containing the commit ID that the tag points to, what's the difference between them?

git tag show

If both lightweight and annotated tags create a ref in the. What is the difference between Git lightweight tags and Git annotated tags?









Git tag show