Fundamentals 2 min read

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.

Laravel Tech Community
Laravel Tech Community
Laravel Tech Community
How to Create, Push, List, Switch, and Delete Git Tags

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 --tags

The --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 commit

5. Delete a local tag git tag -d 0.1.3 6. Delete a remote tag git push origin :refs/tags/0.1.3 Remember to share this useful guide if you found it helpful.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

software developmentGitVersion ControlTagging
Laravel Tech Community
Written by

Laravel Tech Community

Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.