To create and apply Git tags to mark specific commits, you can follow these steps:
Check the list of your existing tags using the command:
git tag
To create a new tag, use the following command:
git tag <tag-name>
Replace <tag-name>
with the desired name of your tag.
If you want to create an annotated tag and add a message to it, use:
git tag -a <tag-name> -m "Your annotation message"
To apply an existing tag to a specific commit, find the commit's hash using git log
, and then use the command:
git tag -a <tag-name> <commit-hash>
Push the created tag to your remote repository using:
git push origin <tag-name>
Replace <tag-name>
with the name of the tag you want to push.
If you want to push all tags at once, use:
git push origin --tags
Note: Remember to have proper permissions to push the tags to the remote repository.
That's it! You have created and applied Git tags to mark specific commits.