What is the difference between an annotated tag and a lightweight tag in Git, and when would you choose each?
- Annotated tags are full objects with metadata/signature; lightweight are pointers to a commit
- Annotated preferred for releases (authors, messages, signing)
- Lightweight for quick local markers or temporary refs
- 💡Mention `-a`, `-s`, and `git describe`.
- ⚠️Using lightweight tags for official releases or shared milestones, which omits critical metadata and the ability to verify authenticity.
- ⚠️Forgetting to push tags: Tags (especially annotated ones) are not automatically pushed with `git push` by default; `git push --tags` is often required.
- ⚠️Creating annotated tags but providing generic or empty messages, negating the benefit of their rich metadata.
- ⚠️Confusing the static nature of lightweight tags with the movable nature of branches, leading to misunderstandings about version history.
- ⚠️Over-tagging or using annotated tags for every minor commit, which can clutter the repository and add unnecessary overhead for local markers.
- ❓How do you push tags to remote?
- ❓How to delete a remote tag?
Ready to prove your AWS DevOps knowledge?
Practice with free DevOps Engineer Professional (DOP-C02) exam questions. Instant answers and detailed explanations — no account required.
Start free practice quizQuestions that share similar topics with this one
Git Merge vs Rebase
BeginnerGit Fast-Forward vs --no-ff
BeginnerGit Stash vs Creating a Branch
BeginnerGit Shallow Clone
BeginnerBlue-Green vs Canary Deployments with Feature Flags
AdvancedDeepen your knowledge with these related blog posts
Monorepo vs Polyrepo: Choosing the Right Repository Strategy for Your Microservices
A comprehensive guide to choosing between monorepo and polyrepo strategies when decomposing monoliths into microservices. Learn the trade-offs, implementation patterns, and real-world considerations that matter in production.
Release Engineering Playbook: Blue/Green, Canary, and Feature Rollouts
Master blue/green, canary, and rolling deployment strategies. Learn how to integrate automated smoke tests, release gates, feature flags, and rollback techniques for safer, faster releases.
GitHub Self-Hosted Runners on AWS: Pull vs Push for On-Demand Scaling
Cut your CI costs by running GitHub Actions on AWS only when you need them. Compare pull-based (polling) and push-based (event-driven) architectures for spinning up on-demand self-hosted runners.