git tag
A name fixed permanently to one commit, usually to mark a release such as v1.0, and the command that creates and lists them.
In more detail
Unlike a branch, a tag does not move when you commit. git tag v1.0 makes a lightweight tag, just a name, while git tag -a v1.0 -m 'Release version one' makes an annotated tag with its own author, date and message. Tags are not pushed automatically: use git push origin v1.0, or --tags for all of them.
Examples
In the course lab every deployment is an annotated tag named deploy-NNNN, and the tagger date is when it shipped.git -C fixture tag -l 'deploy-*' | wc -lgit tag -a v1.0 -m 'Release version one'git push origin v1.0git tag v1.2.0 && git push origin v1.2.0In Terraform: Modules kept in Git are pinned by tag in the source address, because the version argument only works for registry sources. The Terraform Registry also publishes module versions from tags.Related terms
- ref — A Git name that points at a commit, such as a branch (refs/heads/main) or a tag (refs/tags/v1.0).
- semantic versioning — A version numbering scheme of three numbers, major.minor.patch, raised for breaking changes, new features and fixes respectively.
- pinning — Fixing an exact version or digest of something you depend on so it cannot change without you noticing.
- Git — A free, open-source distributed version control system that records the history of a project as a chain of snapshots.
- commit — A saved snapshot of the whole project in Git, together with its author, committer, time, message and a pointer to the commit before it.
- deployment frequency — The number of deployments to production over a period, or equivalently the time between deployments.
- annotated tag — A tag stored as its own Git object, with the tagger's name, a date and a message, pointing at a commit.
- lightweight tag — A tag that is only a name pointing at a commit, with no message, author or date of its own.
- GitHub Releases — A GitHub feature that turns a Git tag into a release page with notes and downloadable files.
- module source — The source argument of a module block, which says where to get the module: a local path such as ./modules/network, the registry, or a Git address.
Taught in
- Triggers and the Event Model — Continuous Integration & Continuous Delivery Pipelines
- Throughput: Change Lead Time And Deployment Frequency — DevOps & Site Reliability Engineering
- The Pitfalls Of Measurement — DevOps & Site Reliability Engineering
- HEAD, And Why Detached HEAD Is Not An Error — Advanced Git Internals & Distributed Workflows
- Tags And Releases — Advanced Git Internals & Distributed Workflows
- Triggers In Depth: Filters, Schedules And Dispatch — GitHub Actions (GH-200) Exam Prep
- Composite And Docker Actions: Troubleshooting And Immutable Releases — GitHub Actions (GH-200) Exam Prep
- Distributing And Versioning Actions: Tags, SHAs And Marketplace — GitHub Actions (GH-200) Exam Prep
- YAML-Reading Sprint: What Happens When This Runs? — GitHub Actions (GH-200) Exam Prep
- Versioning And Pinning Modules — Infrastructure as Code with Terraform
- Where Modules Come From — HashiCorp Terraform Associate (004) Exam Prep