Branching Style
The BodhiTree Git branching structure.
Purpose
To ensure clear organization, maintainability, and collaboration across teams.
Git branching structure matrix
Branch Type |
Naming Convention |
Purpose |
Branching From |
Merging Into |
Rules |
|---|---|---|---|---|---|
Production Branch |
|
Represents the latest stable release of the project. |
Hotfix, Release (initially) |
No direct commits |
Must always be in a deployable state. Merged only via PRs. No direct commits allowed. |
Development Branch |
|
Contains the latest development code. |
Feature, Bugfix (initially) |
|
Protected. All features and bugfixes must pass code review before merging. |
Feature Branch |
|
Develops individual features or enhancements. |
|
|
Feature must be reviewed and tested before merging. Regularly updated with latest |
Bugfix Branch |
|
Resolves bugs found in the development phase. |
|
|
Must fix the issue associated with an open bug ticket. Follows similar rules as feature branch. |
Release Branch |
|
Prepares the codebase for production release. |
|
|
Only minor bug fixes and release changes are allowed. Should be tagged upon merging to |
Hotfix Branch |
|
Urgently fixes critical issues in production. |
|
|
Created for immediate production fixes. Merges back into |
Key Points
Production Branch (
main):Always deployable and contains the latest production-ready code.
No direct commits; merges only from
releaseandhotfixbranches.
Development Branch (
dev):Integrates features and bugfixes.
Periodically merged into
releasefor preparation for production.
Feature and Bugfix Branches:
Each feature/bugfix gets its own branch.
Branch from
devand merge back intodevupon completion.
Release Branches:
Created when preparing for a production release.
Only minor fixes or version updates are allowed.
Hotfix Branches:
Created to handle urgent production fixes.
Merges back into both
mainanddevto ensure the codebase remains in sync.
Merge Rules
All merges to
mainordevshould go through pull requests (PRs).Code must pass all tests and be reviewed before merging.
mainanddevbranches should be protected to prevent accidental commits.
Key Points for Quarterly Releases
Versioning System:
The version number is formatted as year.month, where the month reflects the quarter’s primary release.
Code Freeze: A code freeze will be enforced two weeks prior to the release date to ensure stability and adequate testing.
Testing and Review: The final code for each release will undergo thorough testing and code review before it is merged into the main branch.
Tagging: Each release will be tagged in Git with its corresponding version number (e.g., 2024.01).
Merging Process for Releases
Release branches (release/version-number) are created from dev and will be merged back into both prod and dev after the release to keep all branches up to date.
Hotfixes made after a release will be added directly to prod and merged back into dev to ensure consistency across environments.
See also
Writing a Git Message: the commit message format used on every branch.
Merge Request Checklist: what a branch needs before it can be merged.
Versioning Convention: how release numbers are chosen.