This document describes the Git branching strategy used in the Three Horizons Accelerator project.
| Branch | Purpose | Protected | Direct Push |
|---|---|---|---|
main |
Production-ready code | Yes | No |
develop |
Integration branch for development | Yes | No |
feature/* |
New features | No | Yes |
fix/* |
Bug fixes | No | Yes |
hotfix/* |
Urgent production fixes | No | Yes |
# Start from develop
git checkout develop
git pull origin develop
# Create feature branch
git checkout -b feature/my-new-feature
# Make changes, commit
git add .
git commit -m "feat: add new feature description"
# Push feature branch
git push origin feature/my-new-feature
# Create PR to develop# Start from develop
git checkout develop
git pull origin develop
# Create fix branch
git checkout -b fix/bug-description
# Fix the bug, commit
git add .
git commit -m "fix: resolve bug description"
# Push and create PR to develop
git push origin fix/bug-description# Ensure develop is up to date
git checkout develop
git pull origin develop
# Create PR from develop to main via GitHub
# PR will be validated by CI pipeline
# Requires approval before merge# Start from main
git checkout main
git pull origin main
# Create hotfix branch
git checkout -b hotfix/critical-fix
# Apply fix, commit
git add .
git commit -m "fix: critical production issue"
# Push and create PR to main
git push origin hotfix/critical-fix
# After merge to main, also merge to develop
git checkout develop
git merge main
git push origin develop- Required reviews: 1 approval minimum
- Required status checks:
- CI pipeline must pass
- Branch protection validation
- Security scans (TFSec, Checkov, Gitleaks)
- Restrictions:
- No direct pushes
- PRs must come from
developbranch only - No force pushes
- No branch deletion
- Required reviews: 1 approval minimum
- Required status checks:
- CI pipeline must pass
- Pre-commit checks
- Restrictions:
- No force pushes
We follow Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional footer]
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation changes |
style |
Code style changes (formatting, etc.) |
refactor |
Code refactoring |
perf |
Performance improvements |
test |
Adding or updating tests |
build |
Build system changes |
ci |
CI/CD changes |
chore |
Other changes (dependencies, etc.) |
revert |
Reverting previous changes |
feat(terraform): add cost management module
fix(ci): resolve YAML parsing error in workflow
docs: update branching strategy documentation
refactor(aks): simplify node pool configuration
ci: add branch protection workflowFollow the same conventional commit format:
feat(module): add new capability
fix(workflow): resolve issue with validation
Use the PR template and include:
- Description - What changed and why
- Type of Change - Feature, fix, docs, etc.
- Related Issues - Link to issues
- Testing - How it was tested
- Checklist - Verify all items
Before requesting review:
- Code follows project style guidelines
- Self-review completed
- Documentation updated
- Tests added/updated
- Pre-commit hooks pass
- CI pipeline passes
- Go to Settings > Branches
- Add rule for
main:- Require pull request reviews (1 approval)
- Require status checks to pass
- Require branches to be up to date
- Include administrators
- Add rule for
develop:- Require pull request reviews (1 approval)
- Require status checks to pass
For main branch:
validate-pr-sourceCI / terraform-validateCI / terraform-securityCI / ci-summary
For develop branch:
CI / terraform-validateCI / ci-summary
# Update develop
git checkout develop && git pull
# Create feature
git checkout -b feature/xyz
# Work and commit
git add . && git commit -m "feat: description"
# Push and create PR
git push origin feature/xyz# On GitHub:
# 1. Go to develop branch
# 2. Create PR to main
# 3. Fill PR template
# 4. Request review
# 5. Merge after approval# Clean up feature branch
git checkout develop
git pull origin develop
git branch -d feature/xyz
git push origin --delete feature/xyzPRs to main must come from develop. If you need to merge a feature directly:
- First merge to
develop - Then create PR from
developtomain
- Check the CI logs
- Run pre-commit locally:
pre-commit run --all-files - Run Terraform validation:
terraform validate - Fix issues and push
# Update your branch with latest develop
git checkout your-branch
git fetch origin
git merge origin/develop
# Resolve conflicts
git add .
git commit -m "chore: resolve merge conflicts"
git pushLast Updated: December 2025