Tagging in Git
Git also allows users to tag specific versions of the repository with meaningful names. For example, you have completed the first version of your application and you want to tag this point.
In this tutorial, you’ll learn how to create tags in a git repository, list existing tags, etc.
Create New Tags
Your project has reached to release 1.0. You can tag this point using switch -a
with name v1.0 in your repository.
Push your tag to the remote repository using the command:
After a few days, your project reaches release 1.2. You tagged this point with name v1.2 and push the tag to the remote.
Now, suppose you forgot to tag your project for version v1.1. You can make a tag to the previous commit later. First, find the commit logs and select the commit to which you need to tag.
Listing Tags
You can list all the tags available in your repository.
You can see the tag data along with the commit that was tagged by using the git show command:
Checkout Tags
You need the code of a specific tag for review of fixing some issues. The best way to do this checks out the code for the specific tag to a new branch. The below command will create a new branch named version1.1 using the code from tag v1.1.
Delete Tags
Assume you have no more need for some old tags. You can delete them using the git tag command. For example remove a tag named “v1.0”.
0 Comments
CAN FEEDBACK
Emoji