0
0
Gitdevops~15 mins

Lightweight vs annotated tags in Git - Hands-On Comparison

Choose your learning style9 modes available
Lightweight vs Annotated Tags in Git
📖 Scenario: You are working on a software project using Git. You want to mark specific points in your project history to easily find important versions later. Git offers two types of tags: lightweight and annotated. You will create both types of tags and see how they differ.
🎯 Goal: Learn how to create lightweight and annotated tags in Git and understand the difference between them by listing tags and viewing tag details.
📋 What You'll Learn
Create a lightweight tag named v1.0-light
Create an annotated tag named v1.0-annotated with a message
List all tags to see both tags
Show details of the annotated tag
💡 Why This Matters
🌍 Real World
Tags help mark important points in project history, like releases or milestones, making it easy to find and share versions.
💼 Career
Knowing how to use tags is essential for software developers and DevOps engineers to manage releases and collaborate effectively.
Progress0 / 4 steps
1
Create a lightweight tag
Create a lightweight tag named v1.0-light on the current commit using the command git tag v1.0-light.
Git
Need a hint?

A lightweight tag is like a bookmark to a commit. Use git tag followed by the tag name.

2
Create an annotated tag
Create an annotated tag named v1.0-annotated with the message "Release version 1.0 annotated" using the command git tag -a v1.0-annotated -m "Release version 1.0 annotated".
Git
Need a hint?

Annotated tags store extra information like the tagger name, date, and a message. Use -a and -m options.

3
List all tags
List all tags in the repository using the command git tag to see both v1.0-light and v1.0-annotated.
Git
Need a hint?

Use git tag without arguments to list all tags.

4
Show details of the annotated tag
Show details of the annotated tag v1.0-annotated using the command git show v1.0-annotated.
Git
Need a hint?

Use git show followed by the tag name to see tag details including the message.