Tagging commits in the repository

If you are releasing software with Git, you are bound to deal with tags. Tags describe the different software releases in the repository. There are two types of tags, a lightweight tag and an annotated tag. The lightweight tag is very similar to a branch, since it is just a named reference, such as refs/tags/version123 . This points to the commit hash of the commit you are tagging; whereas if it were a branch, it would be refs/heads/version123. The difference is that the branch moves forward when you work and commit to it. A tag will always point to the same commit hash. We will discuss the annotated tag shortly.

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.