11/24/2023 0 Comments Git tag history![]() That's why people get confused: they don't know whether master means refs/heads/master or refs/tags/master. Note that git checkout effectively prefers the branch though. :-) )Ä¡Actually, so will git show master: some Git commands, including git show, "prefer" the tag when it's ambiguous like this. (If the person turns out to be you, ask yourself why you did that. If this is an annotated tag, inspect it- git show refs/tags/master will do the trick for instance 1-and then ask the person who created it what they thought they were doing and what name they'd like you to use instead, and then rename or delete the tag. Tags are associated with commits, so you can use a tag to mark an individual point in your repositorys history, including a version number for a release. Lightweight tags have no additional information, but annotated tags record the person who creates them, in much the same way that commits record the person who creates them. Git handles this just fine, but humans get confused. ![]() Let's tag the last commit on the dev branch by executing the following command: git tag ongoing dev. We can now create a tag onto any of these commits. Execute the following command to view the commits: git log -oneline. As you can see, the -a specifies that you are creating an annotated tag, after comes the tag name and finally, the -m followed by the tag message to store in the Git database. It's unwise to use the same name for a branch and a tag. Check if you have a clean working directory. To create an anotated tag, add -a tagname -m 'tag message' to the git tag command: git tag -a v4.0 -m 'release version 4.0' git tag v1.0 v2.0 v3.0 v4.0. You can optionally choose the use most recent tag option, which will then export the tag name and message from the nearest tag in the history of the commit. The meaning, if there is one, is whatever you think it is. But by the same token, the branch name master does not mean anything either. A tag named master does not mean anything.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |