We follow the Gitflow branching model to keep development, reviews, and releases predictable and consistent.
Reference documentation: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
develop: default integration branch for day-to-day work.- Set
developas the default branch in the GitHub repository settings.
- Set
main: release/production branch.- Updates to
mainhappen as part of the release process (and should be protected).
- Updates to
- Developer branches: short-lived branches created from
develop(e.g.feature/*,bugfix/*). - Hotfix branches: created from
mainonly for urgent production issues (e.g.hotfix/*).
- Branch from
developfor normal development work (features, bug fixes, refactors, etc.). - Open a Pull Request back into
developfor every change. No direct merges intodevelop. - Rebase on top of
developbefore merging (or before final review), and resolve conflicts in your branch.- This keeps the commit history flat and readable, and makes it easier to understand what changed in a single PR/merge (a clean, linear sequence of commits that belongs to one integration into
develop).
- This keeps the commit history flat and readable, and makes it easier to understand what changed in a single PR/merge (a clean, linear sequence of commits that belongs to one integration into
- Keep
developalways mergeable intomain(i.e., after changes land indevelop, mergingdevelop→mainshould not require conflict resolution).
- Every PR must reference a GitHub issue using standard closing keywords in the PR description, for example:
closes #<issue-number>fixes #<issue-number>
- The referenced issue should live in the same repository as the PR.
- If a task spans multiple repositories, create a tracking issue (sub-task) in each repository and reference the appropriate issue from each PR.
A PR can be merged only when:
- Review is completed (when more than one developer is active on the project)
- All CI checks are green
Best practice: enforce the above using GitHub branch protection rules.
developer branch → develop → main
The reverse direction (main → develop) is reserved only for exceptional cases, such as urgent production issues.
- Create a hotfix branch from
main - Merge it directly into
main - Sync the fix back into
developas soon as possible (via PR)
We should follow these rules by default, but not rigidly. There are valid exceptions, for example:
- A colleague is on holiday and no one else can review
- Single-person projects, where review does not make sense
- Depending on the project and its environments, sometimes the default branch can be
maininstead ofdevelop- Example: a demo dashboard with no staging/testing environment, where changes go directly to production and the project has low impact