“It works on my machine.” “I thought we deployed that fix.” “Which commit is in prod?” “Is staging up to date?”
Version tags like v1.2.3 can point to multiple commits. Tags move. Tags get retagged. Git hashes don’t. Same hash equals identical code, guaranteed. Cryptographic proof.
The solution: Every service exposes a /version endpoint returning its git hash. Instantly verify what’s deployed.
Backend: Capture Hash at Build Time
Docker images don’t contain .git directories. Capture the hash during build and bake it into the image: