Gitflow
Gitflow
Section titled “Gitflow”Branch model
Section titled “Branch model”Two long-lived branches:
| Branch | Environment | Access |
|---|---|---|
main | Production | Protected — PR required |
develop | Hors-prod (dev) | Protected — PR required |
Feature workflow
Section titled “Feature workflow”develop │ ├── feat/my-feature ← branch from develop │ │ │ └── PR → develop ← code review + CI │ ├── (PR merge) │ └── release/vX.Y.Z ← branch from develop when ready │ └── PR → main ← final QA, then tagBranch naming
Section titled “Branch naming”| Type | Pattern | Example |
|---|---|---|
| Feature | feat/<short-name> | feat/redis-metrics |
| Bug fix | fix/<short-name> | fix/kafka-timeout |
| Release prep | release/vX.Y.Z | release/v0.6.0 |
| Hotfix | hotfix/<short-name> | hotfix/nil-pointer |
CI/CD matrix
Section titled “CI/CD matrix”| Event | CI | Dev deploy | Prod deploy |
|---|---|---|---|
Push to feat/*, fix/* | Tests + vet | — | — |
PR to develop | Tests + vet | — | — |
Push to develop | Tests + vet | dev image | — |
Push to release/** | Tests + vet | rc-<sha> image | — |
Push to main | Tests + vet | — | — |
Tag gateway/vX.Y.Z | Tests | — | vX.Y.Z image + GitHub Release |
Tag relay/vX.Y.Z | Tests | — | vX.Y.Z image + GitHub Release |
Helm chart change on main | — | — | Helm chart published to GitHub Pages |
Common commands
Section titled “Common commands”# Start a featuregit checkout develop && git pullgit checkout -b feat/my-feature
# Open PR to developgh pr create --base develop --title "feat: ..."
# Create a release branchgit checkout develop && git pullgit checkout -b release/v0.6.0
# Open PR to maingh pr create --base main --title "release: v0.6.0"Hotfixes
Section titled “Hotfixes”Hotfixes branch from main and are merged back to both main and develop:
git checkout main && git pullgit checkout -b hotfix/critical-fix
# fix, commit, PR → maingh pr create --base main --title "fix: critical fix"
# after merge: back-merge to developgit checkout develop && git pullgit merge maingit push origin develop