O'Reilly logo

Git: Mastering Version Control by Jakub Narębski, Rasmus Voss, Aske Olsson, Ferdinando Santacroce

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Tagging commits in the repository

If you are releasing software with Git, you are bound to deal with tags as the tag describes 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 like refs/tags/version123, which 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 the branch moves forward when you work and commit to it. The tag should always point to the same commit hash.

Getting ready

Before we start, you must go to the chapter5 directory, where we made the original clone for this chapter.

We should start by tagging ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required