0
0
Gitdevops~20 mins

Semantic versioning with tags in Git - Mini Project: Build & Apply

Choose your learning style9 modes available
Semantic versioning with tags
📖 Scenario: You are working on a software project and want to keep track of your releases using semantic versioning tags in Git. Semantic versioning uses tags like v1.0.0, v1.1.0, and v2.0.0 to mark major, minor, and patch releases.
🎯 Goal: You will create a Git repository, add some commits, and then create semantic version tags to mark your releases. Finally, you will list the tags to see your version history.
📋 What You'll Learn
Initialize a Git repository
Create at least two commits
Create semantic version tags with exact names
List all tags to verify
💡 Why This Matters
🌍 Real World
Semantic versioning tags help developers and users know which version of the software they are using. This is important for tracking changes and compatibility.
💼 Career
Many software projects use Git tags for release management. Knowing how to create and manage semantic version tags is a key skill for developers and DevOps engineers.
Progress0 / 4 steps
1
Initialize Git repository and create first commit
Initialize a new Git repository using git init. Then create a file named README.md with the content "Project start". Add the file to Git and commit with the message "Initial commit".
Git
Need a hint?

Use git init to start the repo. Use echo to create the file. Then add and commit.

2
Create second commit with a new file
Create a file named app.py with the content "print('Hello World')". Add and commit this file with the message "Add app.py".
Git
Need a hint?

Create the file with echo, then add and commit it.

3
Create semantic version tags
Create two tags: v1.0.0 for the first commit and v1.1.0 for the second commit. Use git tag with the exact tag names. Tag the commits in the order they were made.
Git
Need a hint?

Use HEAD~1 to tag the first commit and HEAD for the latest commit.

4
List all semantic version tags
Use git tag to list all tags in the repository. This will show your semantic version tags.
Git
Need a hint?

Just run git tag to see all tags.