![]() Say you have multiple environments that you deploy to and you only want certain versions of the codebase in one environment. The best use I have found for tags is to use them to help with the releases of your app. For example, using the previous example tags we can run this: Git checkout tags/tag-your-it From here we can check out a tag using the checkout command. With that command, you will have all the up-to-date tags pulled down into your remote repository. To get the latest tags, you must perform a Git fetch command. You don’t get up-to-date tags when you do a Git pull. That means if someone creates a tag, it will be available to everyone with access to the repository. The first thing to understand is that Git tags are not branch-specific but repository-specific. Much like any other tool, there are some caveats. So, that sounds great, but how do you actually tag a commit? The command is this: Git tag Also important to note is that tag names are unique, meaning no two tags will have the same name to avoid confusion. If you really felt like it you could name a tag “tag-your-it” and the next one “No-tag-your-it” and the following one “it-is-you’re-not-your.” Those tag names will now be tied to the commits you’re currently on when creating the tag. This tag will come with a message or title to help identify it in the sea of tags. This can be on any commit for any branch that is currently part of the repo. To put it simply, Git tagging is creating a named marker on a specific commit of a repository. Let’s start by talking about what tagging in Git is and how to go about it. ![]() Tagging in Git is not a new concept, and some readers might be thinking, “Why am I reading this article about Git tags?” But, for those who are curious or who have never used Git tags before, I will explain what tagging is and the best use of these tags.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |