Tag a release
- Git course
- Intermediate
- Lesson 70/82
- 5 min
Mark a release point with an annotated tag.
Marking a release with an annotated tag
An annotated tag is a Git tag with additional information that marks a specific commit as a release point. Unlike a lightweight tag, it contains extra details such as a tag message, creator, and date. It is commonly created during release preparation using the -a option.
git tag -a v1.0.0 -m "Version 1.0.0"Release version and tag message
Tag names commonly use version numbers such as v1.0.0. The -m option adds a message explaining why the tag was created. You can inspect the tag you created with the git show v1.0.0 command.
git tag -a v1.2.0 -m "First stable release"
git show v1.2.0Practice Create a release tag
Create an annotated tag named v2.1.0. Set its message to Stable version 2.1.0. Write the complete command.
Starter code
# Annotated tag oluşturExpected output
Etiket başarıyla oluşturuldu.
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Which command creates a release tag with an annotation message?
- git branch -a v1.0.0
- git commit -m "v1.0.0"
- git tag -a v1.0.0 -m "Version 1.0.0" Correct answer
- git tag v1.0.0
Explanation: -a creates an annotated tag, while -m specifies its annotation message.
2 Define the tag message
git tag -a v2.0.0 -m "____"
git tag -a v2.0.0 -m "Major release"
Explanation: The tag message is written in quotation marks after the -m option.
3 Annotated tag components
| Term | Meaning |
|---|---|
-a |
Creates an annotated tag |
-m |
Specifies the tag message |
v2.0.0 |
Release tag name |
git show |
Displays tag information |