What is a Git tag, and how do you use it for releases?
Short answer: A Git tag marks specific points in a repository’s history — usually to label release versions (like v1.0, v2.1, etc.).
Explain a bit more
It’s like a snapshot that says, “this commit is stable and ready to release.” Types of tags: Lightweight tag: just a name for a commit. Annotated tag: includes metadata like the tagger’s name, date, and message. Commands: git tag -a v1.0 -m "Version 1.0 release" git push origin v1.0 Real-world example: After testing your project, you tag the commit representing your first release with v1.0. This helps other developers or CI/CD pipelines identify which version is live.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png