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.
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.
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:
Then, create a tag for that commit:
🔹 Deleting a Tag (git tag -d)
If you created a tag by mistake or need to remove an old one, use:
This removes the tag locally, but it still exists in the remote repository.
To delete it from the remote repository:
🔹 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:
To push all tags at once:
2️⃣ Fetching Tags from Remote Repository
When you clone a repository, tags are not fetched by default. To fetch all tags:
3️⃣ Checking Available Tags
To list all tags in a repository:
For more details:
🔹 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!
2️⃣ The Psychology of Money – Master your financial mindset!
3️⃣ Think and Grow Rich – Unlock the secrets to wealth and success!
4️⃣ The Power of Your Subconscious Mind – Train your mind for success!
5️⃣ Rich Dad Poor Dad – Learn financial lessons the rich teach their kids!
No comments:
Post a Comment