Git

Lesson 10

Tags and release points

Create intentional annotated tags for release points after verifying the exact commit that should ship.

Good Code

release-tag.sh
# Verify the exact commit before creating the release tag.
git status --short --branch
npm test
git log --oneline --max-count=1
git tag -a v1.4.0 -m "Release v1.4.0"
git push origin v1.4.0

Bad Code

release-tag.sh
# Vague tags and bulk pushes can publish accidental release points.
git tag latest
git push --tags

Review Notes

What to review

Good Code

The good version verifies the working tree, runs tests, checks the exact commit, creates an annotated version tag, and pushes only that tag.

Bad Code

The bad version creates a vague moving name and pushes every local tag, including tags that may not be ready to publish.

Takeaways

  • A release tag should point to a verified commit and carry a clear versioned meaning.