0
0
Gitdevops~15 mins

Creating tags in Git - Try It Yourself

Choose your learning style9 modes available
Creating tags
📖 Scenario: You are working on a software project using Git. You want to mark specific points in your project's history with tags. Tags help you label important versions like releases.
🎯 Goal: You will create a Git tag named v1.0 on the current commit and then display the list of tags in your repository.
📋 What You'll Learn
Create a lightweight Git tag named v1.0
List all tags in the repository
💡 Why This Matters
🌍 Real World
Tags are used to mark release versions or important milestones in software projects.
💼 Career
Knowing how to create and manage Git tags is essential for software developers and DevOps engineers to organize and track project versions.
Progress0 / 4 steps
1
Create a lightweight tag named v1.0
Use the Git command git tag v1.0 to create a lightweight tag named v1.0 on the current commit.
Git
Need a hint?

A lightweight tag is created by just specifying the tag name after git tag.

2
Verify the tag was created
Use the Git command git tag to list all tags and verify that v1.0 appears in the list.
Git
Need a hint?

Running git tag without arguments lists all tags.

3
Create an annotated tag named v1.0-annotated
Use the Git command git tag -a v1.0-annotated -m "Version 1.0 release" to create an annotated tag named v1.0-annotated with the message Version 1.0 release.
Git
Need a hint?

Annotated tags include a message and are created with -a and -m options.

4
List all tags to see both lightweight and annotated tags
Use the Git command git tag again to list all tags and confirm both v1.0 and v1.0-annotated appear.
Git
Need a hint?

Running git tag lists all tags, showing both lightweight and annotated tags.