Git tags are like markers on your project's timeline - they help you identify important versions like releases, milestones, or critical points in development. Tags come in two varieties: lightweight for simple marking and annotated for richer metadata, giving you flexibility in how you document your project's version history.
Creating a Lightweight Tag
Use git tag v1.0 to create a simple tag that points to a specific commit. Lightweight tags are quick to create and perfect for marking release points without extra metadata.
$ git tag v1.0
Try it Yourself โ
Pushing Tags
To share your tags with the world, use git push origin v1.0. This uploads your tag to the remote repository, making it available to everyone working on the project.
$ git push origin v1.0
Try it Yourself โ
Creating Annotated Tags
For more detailed tags with author information and dates, use git tag -a v2.0 -m "Version 2.0 release". Annotated tags create an object in the repository with additional metadata.
$ git tag -a v2.0 -m "Version 2.0 release"
Try it Yourself โ