This document outlines our Git branching strategy and protection rules.
-
prod
branch- Main production branch (formerly 'main')
- Contains production-ready code
- Protected branch with strict rules
- Only accepts merges from
alpha
andhotfix/*
branches
-
alpha
branch- Main development branch (formerly 'develop')
- Contains code ready for next release
- Protected branch
- Accepts merges from
feature/*
andrelease/*
branches
-
Feature Branches (
feature/*
)- Naming convention:
feature/feature-name
- Created from:
alpha
- Merges into:
alpha
- Used for new features and non-emergency fixes
- Example:
feature/user-authentication
- Naming convention:
-
Release Branches (
release/*
)- Naming convention:
release/vX.Y.Z
- Created from:
alpha
- Merges into:
alpha
andprod
- Used for release preparation
- Example:
release/v1.2.0
- Naming convention:
-
Hotfix Branches (
hotfix/*
)- Naming convention:
hotfix/issue-description
- Created from:
prod
- Merges into:
prod
andalpha
- Used for emergency production fixes
- Example:
hotfix/fix-login-crash
- Naming convention:
Branch name pattern: prod
√ Require a pull request before merging
√ Require approvals
√ Dismiss stale pull request approvals when new commits are pushed
√ Require status checks to pass before merging
√ Require branches to be up to date before merging
√ Include administrators
√ Allow force pushes: No
√ Allow deletions: No
Branch name pattern: alpha
√ Require a pull request before merging
√ Require approvals
√ Require status checks to pass before merging
√ Require branches to be up to date before merging
√ Include administrators
√ Allow force pushes: No
√ Allow deletions: No
-
Feature Development
alpha → feature/* → alpha
-
Release Process
alpha → release/* → prod
-
Hotfix Process
prod → hotfix/* → prod + alpha
- Triggered automatically when:
- Push to
alpha
branch - Push to
release/*
branches
- Push to
- Deploys the latest successful build to staging environment
- Triggered ONLY when:
- A pull request to
prod
branch is merged - The source branch can only be
alpha
orhotfix/*
- A pull request to
- Requires successful CI pipeline run
- Deploys the exact commit that was merged to production
-
Staging:
alpha/release/* branch → CI Pipeline → Staging Environment
-
Production:
PR merge to prod → CI Pipeline → Production Environment
- Images are tagged with both commit SHA and 'latest'
- Production deployments always use the specific commit SHA tag
- Format:
tensordt/climagent-[frontend|backend]:[sha|latest]
The CI/CD pipeline is configured to run on:
- All pushes to
prod
andalpha
branches - All pushes to
feature/*
,release/*
, andhotfix/*
branches - All pull requests targeting
prod
andalpha
branches
- Repository:
tensordt/climagent
- Image naming:
- Frontend:
tensordt/climagent-frontend:[tag]
- Backend:
tensordt/climagent-backend:[tag]
- Frontend:
- Tags:
latest
: Most recent successful build[git-sha]
: Specific commit version
DOCKERHUB_USERNAME
: Your Docker Hub usernameDOCKERHUB_TOKEN
: Your Docker Hub access token (for authentication)
- Always create feature branches from the latest
alpha
- Keep branches up to date with their parent branch
- Delete feature branches after merging
- Use meaningful and descriptive branch names
- Follow the branch naming conventions strictly