Skip to main content

9️⃣ Git Tags

 

9️⃣ Git Tags


In Git, tags are used to mark specific points in a repository's history, often for releases (like v1.0, v2.0). Tags are similar to branches but do not change—they are just references to specific commits.



🌍 Shape Your Future with AI & Infinite Knowledge...!!

🌐 Want to Generate Text-to-Voice, Images & Videos? 👉 http://www.ai.skyinfinitetech.com 📚 Read In-Depth Tech & Self-Improvement Blogs 👉 http://www.skyinfinitetech.com ▶ Watch Life-Changing Videos on YouTube 👉 https://www.youtube.com/@SkyInfinite-Learning 🔥 Transform Your Skills, Business & Productivity – Join Us Today! 🔥



🔹 Creating a Tag (git tag)

To create a tag, you first need to find the commit you want to tag.

1️⃣ Creating a Lightweight Tag

A lightweight tag is simply a reference to a commit without additional metadata.


git tag v1.0

This tags the latest commit as v1.0.


2️⃣ Creating an Annotated Tag

Annotated tags store extra information like the author's name, email, and date.


git tag -a v1.0 -m "Version 1.0 release"

Use -a to create an annotated tag and -m to add a message.


3️⃣ Creating a Tag for an Older Commit

If you need to tag a past commit, find its commit hash using:


git log --oneline

Then, create a tag for that commit:


git tag -a v1.0 <commit-hash>


🔹 Deleting a Tag (git tag -d)

If you created a tag by mistake or need to remove an old one, use:


git tag -d v1.0

This removes the tag locally, but it still exists in the remote repository.

To delete it from the remote repository:


git push origin --delete v1.0


🔹 Pushing and Fetching Tags

1️⃣ Pushing a Tag to Remote Repository

By default, tags are not pushed when you run git push. To push a specific tag:


git push origin v1.0

To push all tags at once:


git push --tags


2️⃣ Fetching Tags from Remote Repository

When you clone a repository, tags are not fetched by default. To fetch all tags:


git fetch --tags


3️⃣ Checking Available Tags

To list all tags in a repository:


git tag

For more details:


git tag -n


🔹 Best Practices for Using Git Tags

✅ Use annotated tags for official releases.
✅ Use lightweight tags for temporary references.
✅ Keep consistent naming conventions (e.g., v1.0, v1.1, release-2024).
✅ Always push tags to remote after creating them locally.





📚 Top 5 Books That Will Change Your Life!(Top 5 Life-Changing Books) 🚀


1️⃣ Atomic Habits – Build powerful habits and break bad ones!

👉 Get it here

2️⃣ The Psychology of Money – Master your financial mindset!

👉 Get it here

3️⃣ Think and Grow Rich – Unlock the secrets to wealth and success!

👉 Get it here

4️⃣ The Power of Your Subconscious Mind – Train your mind for success!

👉 Get it here

5️⃣ Rich Dad Poor Dad – Learn financial lessons the rich teach their kids!

👉 Get it here





Comments

Popular posts from this blog

Introduction to Terraform – The Future of Infrastructure as Code

  Introduction to Terraform – The Future of Infrastructure as Code In today’s fast-paced DevOps world, managing infrastructure manually is outdated . This is where Terraform comes in—a powerful Infrastructure as Code (IaC) tool that allows you to define, provision, and manage cloud infrastructure efficiently . Whether you're working with AWS, Azure, Google Cloud, or on-premises servers , Terraform provides a declarative, automation-first approach to infrastructure deployment. Shape Your Future with AI & Infinite Knowledge...!! Read In-Depth Tech & Self-Improvement Blogs http://www.skyinfinitetech.com Watch Life-Changing Videos on YouTube https://www.youtube.com/@SkyInfinite-Learning Transform Your Skills, Business & Productivity – Join Us Today! In today’s digital-first world, agility and automation are no longer optional—they’re essential. Companies across the globe are rapidly shifting their operations to the cloud to keep up with the pace of innovatio...

📊 Monitoring & Logging in Kubernetes – Tools like Prometheus, Grafana, and Fluentd

  Monitoring & Logging in Kubernetes – Tools like Prometheus, Grafana, and Fluentd Monitoring and logging are essential for maintaining a healthy and well-performing Kubernetes cluster. In this guide, we’ll cover why monitoring is important, key monitoring tools like Prometheus and Grafana, and logging tools like Fluentd to help you gain visibility into your cluster’s performance and logs. Shape Your Future with AI & Infinite Knowledge...!! Want to Generate Text-to-Voice, Images & Videos? http://www.ai.skyinfinitetech.com Read In-Depth Tech & Self-Improvement Blogs http://www.skyinfinitetech.com Watch Life-Changing Videos on YouTube https://www.youtube.com/@SkyInfinite-Learning Transform Your Skills, Business & Productivity – Join Us Today! 🚀 Introduction In today’s fast-paced cloud-native environment, Kubernetes has emerged as the de-facto container orchestration platform. But deploying and managing applications in Kubernetes is just half the ba...

🔒 Kubernetes Security – RBAC, Network Policies, and Secrets Management

  Kubernetes Security – RBAC, Network Policies, and Secrets Management Security is a critical aspect of managing Kubernetes clusters. In this guide, we'll cover essential security mechanisms like Role-Based Access Control (RBAC) , Network Policies , and Secrets Management to help you secure your Kubernetes environment effectively. Shape Your Future with AI & Infinite Knowledge...!! Want to Generate Text-to-Voice, Images & Videos? http://www.ai.skyinfinitetech.com Read In-Depth Tech & Self-Improvement Blogs http://www.skyinfinitetech.com Watch Life-Changing Videos on YouTube https://www.youtube.com/@SkyInfinite-Learning Transform Your Skills, Business & Productivity – Join Us Today! 🚀 Introduction: Why Kubernetes Security Is Non-Negotiable As Kubernetes becomes the backbone of modern cloud-native infrastructure, security is no longer optional—it’s mission-critical . With multiple moving parts like containers, pods, services, nodes, and more, Kuberne...