It’s easy to avoid this by creating a comment inline. Using git tag -a without including a message inline will cause Git to open a file in your default editor that stores the annotated tag comment, and won’t complete the process of creating your tag until you save a comment and close the editor. Hint: Waiting for your editor to close the file. Let’s commit a few more changes to file2.ext and try it out: $ git tag -a v1.0.2 To create an annotated tag, simply use the -a option with our previously used Git tag syntax. It’s also worth mentioning that annotated tags include security measures, and can be signed and verified with GNU Privacy Guard (GPG). Git annotated tags are stored as full objects in the Git database, and include useful metadata related to each individual tag.Īnnotated tags allow you to include messages with each tag in similar fashion to commit messages, and also stores the tagger name, email and date the tag was created. Oftentimes, it’s wise to include some additional information when creating tags in Git. git directory that contains the GUID of the tagged commit. We can see from the contents of this file that a Git lightweight tag is simply a file in the. In fact, we can locate our previously created patch version tag in this location and take a look at the contents: $ cat. Git stores each lightweight tag as a file in the. Git defaults to using what are called lightweight tags. $ git tag v1.0.1Īs you can see from the output, we have a new version v1.0.1 that represents our latest patch version update. Keep in mind, git tag will default to currently checked out commit, i.e. Īnd finally, let’s tag this new commit with an updated patch version. Now let's add our changes to Git's staging area and commit them: $ git add. We’ll be updating the patch version using the semantic versioning convention. Next, we’ll add a few lines of comments to the previously empty file file1.ext: file1.ext Let’s take a look at an example Git project tree git-tag-ex/ with a few nested files and a nested directory dir1/: git-tag-ex/
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |