3.4.9 Labels and Branches for Version Management

Use Labels and Branches for Version and Release Management

Git Branching Strategies

StrategyMô tả
GitFlowmain, develop, feature/, release/, hotfix/*
Trunk-basedmain + short-lived feature branches
GitHub Flowmain + feature branches + PRs

Branch → Environment Mapping

main      → Production
develop   → Development/Staging
feature/* → Preview/Ephemeral
release/* → Release candidate
hotfix/*  → Emergency fixes

Git Tags for Releases

git tag -a v1.2.3 -m "Release 1.2.3"
git push origin v1.2.3
  • Semantic versioning: MAJOR.MINOR.PATCH
  • Tags trigger release pipelines
  • Immutable reference points

Lambda Versions as Labels

Version 1 → "Initial release"
Version 2 → "Bug fix"
Version 3 → "New feature"

Alias "prod" → Version 2 (stable)
Alias "beta" → Version 3 (testing)

Container Image Tags

my-app:latest     → Mutable (dev)
my-app:v1.2.3     → Immutable (release)
my-app:sha-abc123  → Git commit SHA

Exam Tip: Git tags for releases. Semantic versioning. Lambda versions = immutable, aliases = mutable pointers. Container tags for version pinning.