Versioning is easy to do with git tags. There are two different types of tags, annotated and lightweight tags.

1. Create a new tag

Annotated tags have extra metadata like author name, release notes, etc. These are important for your project’s public release. you can create an “annotated tag” with -a and this is like commit message.

$ git tag -a <tagname> 
*<tagname> will be v1.0.0

You can add a tag message with -m option

$ git tag -a v1.0.0 -m "New version v1.0.0"

Lightweight tags have only the hash of the commit and don’t have information.

$ git tag <tagname>
*<tagname> will be v1.0.0

2. Push tag

For a single tag

$ git push origin <tagname>

For all tags at once

$ git push origin --tags

3. See all tag lists

$ git tag

Happy coding! 🙂



Write A Comment