Pcornel
Automation · Git

Tag

Cheat sheet · https://pcornel.dk/topic.php?topic=5472

Back to the Topic

Answer

A Git tag is a named reference commonly used to identify a release or milestone; lightweight and annotated tags have different metadata and signing capabilities.

Remember

  • Tag exists ≠ release artifact immutable; tags can be moved unless policy prevents it.
  • Tag name ≠ commit ID; the same name can be force-republished to a different object in poorly governed repositories.
  • Annotated tag ≠ trusted signature automatically; annotation and cryptographic verification are separate.
  • Tag pushed ≠ release built or deployed; downstream release workflows remain separate.

First checks

  • git tag -a v1.2.0 -m 'release' — annotated tag
  • git push origin v1.2.0 — publish
  • git tag -v v1.2.0 — verify signed tag

Verify in this order

commit → tag → release

Where it usually breaks

A tag proves a named Git reference exists at the observed repository state; it does not by itself prove immutability, signature trust or release deployment.

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

Tag Git boundary map

BoundaryHealthy evidenceSuspicious evidence
Local stateRepository, HEAD, worktree/index and commit IDs are explicitWrong repo/ref, hidden staged/untracked state or mutable-name ambiguity
History / refsAncestry and branch/tag movement match intentUnexpected rewrite, stale tracking ref or unclear merge base
Remote syncURL/refspec, auth and remote read-back match expected commitsLocal assumptions, rejection, stale fetch or unsafe force update
Downstream proofBuild/reconciliation/target is verified independentlyPush/tag/merge success treated as deployment success

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5472

Confirmation

Confirm action

Continue?