-
Notifications
You must be signed in to change notification settings - Fork 0
Branching Strategy
This document defines the Git branching strategy, naming conventions, and development workflow used across the project.
The goals of this strategy are:
- Maintain stable production releases
- Keep development workflow simple
- Enable controlled releases
- Improve collaboration and traceability
- Support CI/CD pipelines and automated deployments
| Branch | Purpose |
|---|---|
main |
Production-ready stable code |
dev |
Active development and integration branch |
The main branch always represents:
- Stable production-ready code
- Deployable releases
- Tagged versions/releases
- No direct commits
- Only merge from:
devhotfix/*
- Protected branch recommended
- Every production release should be tagged
The dev branch is the primary integration branch.
All feature development, tasks, UI work, testing, and configurations are merged into dev before being promoted to production.
- Developers branch from
dev - Pull requests target
dev - CI validation must pass before merge
All work should be done using short-lived branches created from dev.
Format:
<type>/<issue-id>-<short-description>
Example:
feature/52-user-report-system
| Type | Purpose |
|---|---|
feature/* |
New features |
hotfix/* |
Production bug fixes |
task/* |
Refactoring/internal engineering tasks |
config/* |
Infrastructure/configuration changes |
ui/* |
Frontend/UI/page-related work |
test/* |
Testing-related tasks |
feature/52-user-report-system
hotfix/81-post-deletion-bug
ui/34-profile-page-redesign
task/91-auth-service-refactor
config/15-nginx-production-config
test/45-auth-integration-tests
Always branch from dev.
git checkout dev
git pull origin dev
git checkout -b feature/52-user-report-systemCommit changes using meaningful commit messages.
| Prefix | Purpose |
|---|---|
feat: |
New feature |
fix: |
Bug fix |
refactor: |
Refactoring |
test: |
Testing |
docs: |
Documentation |
chore: |
Miscellaneous tasks |
feat: add user reporting API
fix: resolve moderation deletion issue
refactor: optimize auth middleware
git push origin feature/52-user-report-systemdev
The following validations must pass before merge:
- Linting
- Type checking
- Tests
- Build validation
- Accessibility checks (frontend)
After approval and successful CI:
feature/* -> dev
When dev becomes stable and ready for production:
dev -> main
git checkout main
git merge devgit tag v1.0.0
git push origin v1.0.0The project follows semantic versioning.
Format:
vMAJOR.MINOR.PATCH
Example:
v1.2.0
| Version Part | Meaning |
|---|---|
| MAJOR | Breaking changes |
| MINOR | New features |
| PATCH | Bug fixes/hotfixes |
Hotfixes are created from main.
git checkout main
git pull origin main
git checkout -b hotfix/81-post-deletion-bugCommit and push normally.
hotfix/* → main
IMPORTANT:
Every hotfix merged into main must also be merged back into dev.
This prevents:
- branch divergence
- bug reintroduction
- inconsistent releases
Runs on:
- PRs to
dev - PRs to
main
Validates:
- linting
- tests
- type checking
- build
- accessibility
Runs on:
push -> dev
Deploys:
- development environment
- latest integration build
Runs on:
git tag v*
Builds:
- production Docker images
- immutable release artifacts
| Tag | Purpose |
|---|---|
dev-latest |
Latest development build |
latest |
Latest stable production release |
| Tag | Purpose |
|---|---|
v1.0.0 |
Official release version |
sha-* |
Exact commit traceability |