main branch is sacred: The main
branch exclusively holds code that is production-ready and suitable for immediate deployment to pre-production.
Feature Isolation: Development of new features or changes takes place in isolated feature branches.
Pull Requests for Integration: Merging features into main
is strictly controlled through pull requests (PRs), enforcing code review and quality checks.
main: The primary branch representing the latest pre-production-ready code. All merges into main
trigger pre-production deployments.
develop: Serves as the integration branch for completed features. Code in develop
should be stable but may not be fully production-ready.
feature/*: Short-lived branches created off develop
for developing individual features or fixes. Names follow a convention like feature/new-widget
.
develop
for fixing bug or issues.Start a Feature:
Create a new branch from the latest main or whatever is your starting point:
git checkout -b feature/my-awesome-change |
Develop the Feature:
Create a Pull Request:
main
branch.Code Review & Testing:
Merge into main:
main
.branch
to main
is approved and merged, a deployment pipeline is automatically triggered to deploy the updated code to EED pre-production environment.Hotfixes: For critical production issues, create branches directly from main
(e.g., hotfix/critical-bug
). Merge hotfixes simultaneously back into both main
(for immediate fix) and develop
(to incorporate into ongoing development).
Release Branches: For managing formal releases to production, you may introduce release branches forked from develop
to harden features and prepare for production deployment.
Versioning: Adopt a versioning scheme (e.g., Semantic Versioning) to track pre-production releases.
Git clients: Support pull requests and efficient branch management (e.g., GitKraken, command-line Git).
CI/CD Pipelines: Implement automated testing and deployment to your pre-production environment, triggered by merges into main
.
Clean release history: main
maintains a well-defined history of deployable code.
Enforced review: Changes undergo review before reaching pre-production.
Parallel development: Multiple features can be developed in isolation.
|