Git Workflow
The Release Train Modelβ
Eli Health uses a Release Train deployment model. Code flows through environments in a predictable, linear sequence:
Key Principle: Board the Trainβ
Once your code is merged to development, it's on the train. All changes move together through staging to productionβno cherry-picking, no skipping releases.
development β A β B β C β D β E β F β G (all new work)
staging β A β B β C β D β E (tested subset)
production β A β B β C (live)
Pull Request Workflowβ
All PRs Target Developmentβ
Every pull request goes against the development branch. No exceptions.
Branch Naming Conventionsβ
| Type | Pattern | Example |
|---|---|---|
| Feature | feature/description | feature/add-hormone-chart |
| Bug Fix | bugfix/description | bugfix/login-crash |
| Hotfix | hotfix/description | hotfix/critical-auth-bug |
Environment Promotionβ
How Changes Move Through Environmentsβ
Promotion Commandsβ
Development β Staging:
git checkout staging
git merge --ff-only development
git push origin staging
Staging β Production:
git checkout production
git merge --ff-only staging
git push origin production
The --ff-only flag ensures linear history and fails if branches have diverged (which shouldn't happen in our workflow).
The Complete Pictureβ
Repositories Using This Workflowβ
All Eli Health repositories follow this branching strategy:
| Repository | Description |
|---|---|
eli-app | Mobile application (React Native) |
eli-backend-api | Backend API service |
eli_hae_api | HAE (Hormone Analysis Engine) API |
eli-kpi | KPI Dashboard |
Branch Strategy Detailsβ
Fast-Forward Merges Between Environmentsβ
Environment branches (staging, production) should never diverge. We use fast-forward merges to maintain linear history:
Before promotion:
After fast-forward:
Commits D, E, F keep their exact same Git hashesβno merge commits, no history rewriting.
Feature Branch Mergingβ
When merging feature branches to development:
Squash Merge (Recommended):
- All feature commits become one clean commit
- Keeps development history readable
- PR description becomes commit message
# Via GitHub PR: Choose "Squash and merge"
Rebase + Fast-Forward:
- Preserves individual commits
- Useful for larger features with logical commit breakdown
Hotfix Processβ
Sometimes bugs need faster resolution than the normal release train allows.
Hotfix Levelsβ
| Level | When to Use | Speed | Branch From |
|---|---|---|---|
| Standard | Can wait for next release | Normal | development |
| Urgent | Critical, needs staging test | Fast | staging |
| Emergency | Production is broken | Immediate | production |
Standard Hotfix (Normal Flow)β
Urgent Hotfix (Skip Dev Testing)β
After deploying to production, back-merge to development to keep branches in sync.
Emergency Hotfix (Production is Down)β
Important: Emergency hotfixes should be rare. Always back-merge to keep all branches synchronized.
Quick Referenceβ
Do's β β
- Create feature branches from
development - Open all PRs against
development - Use squash merges for clean history
- Let all changes flow through the train together
- Back-merge hotfixes to keep branches synchronized
Don'ts ββ
- Never commit directly to
stagingorproduction - Never cherry-pick individual commits between environments
- Never skip the staging environment for normal releases
- Never force push to shared branches
Summaryβ
The Release Train model ensures:
- Predictable releases - Changes flow in one direction
- Quality gates - All code is tested on staging before production
- Simple history - Linear git log, easy to understand
- Team alignment - Everyone's code moves together
All PRs β development β staging β production
β
You are here