How to Create, Push, List, Switch, and Delete Git Tags
This guide explains how to ensure Git is installed, create annotated tags, commit changes, push tags to a remote repository, list and switch to existing tags, and delete both local and remote tags using command‑line Git commands.
Before starting, ensure Git is installed on your computer.
1. Create a tag
git tag -a 0.1.3 -m "Release version 0.1.3"Explanation: git tag creates a tag, -a specifies an annotated tag named 0.1.3, and -m provides a message.
2. Commit changes
git add . git commit -m "fixed some bugs" git tag -a 0.1.3 -m "Release version 0.1.3"3. Push the tag to a remote repository
git push origin master git push origin --tagsThe --tags option pushes all tags; a normal git push origin master does not transfer tags.
4. Switch to an existing tag
git tag --list // view existing tags git checkout [tag/branch/commit] // switch to the specified tag, branch, or commit5. Delete a local tag
git tag -d 0.1.36. Delete a remote tag
git push origin :refs/tags/0.1.3Remember to share this useful guide if you found it helpful.
Laravel Tech Community
Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.