How to Create and Delete Git Tags in GitHub Repository

git tag is used to tag or mark a specific revision as significant, often this will be used during the build deployment and realsing of the code.  Once a tag is created, it’s often referred to by build and deploy scripts instead of the tag’s represented commit.  We can now easily create and delete git tags in GitHub.

Synopsis to Create and Delete Git Tags

To get the complete information on all the options with git tag command checkout Git Tag Official Documentation.

Tagging a Revision

If you would like to tag a specific revision in git, simply use the format git tag {tagname}

This will create a local tag with the current stat of the branch you are on. When you push the code to remote repository tags will not be included by default. You need to explictly pus the tags to your remote repo.

Push Tags to Remote Repository in GitHub

As we  saw earlier the tags are not pushed when you push your changes to remote repo. We need to manually push the tags to remote repo and below is the command to perfrom this action.

Deleting a Git Tag from GitHub

Anytime if you need to remove the tag from the history or GitHub repository you can easily perfrom by using -d flag.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *