Branching Strategy
Our branching strategy is based on the Gitflow Workflow.
Overview
We have two main long-lived branches – main and dev – that remain in the project during its entire lifetime. Additionally, we employ several short-lived branches – feature, release, and hotfix – that are created as needed to manage the development process and deleted once they have fulfilled their purpose. The main branch is the stable production-ready code and the dev branch is where all development takes place. Feature branches are used to develop new features or changes, release branches are used to prepare for a new release, and hotfix branches are used to quickly address critical issues in the production code.
Branches
Feature Development
- Create
featurebranches: When starting work on a new feature or bug fix, create a newfeaturebranch from thedevbranch. - Develop and merge the
featurebranch intodev: Make any necessary changes to your local code on thefeaturebranch. Once the feature is complete and tested, merge the branch back into thedevbranch.
Release Management
- Create the
releasebranch: When it’s time to prepare a new release, create a newreleasebranch from thedevbranch with a descriptive name that includes the version number, for example,release/1.0. Test the release thoroughly to catch any bugs or issues to ensure it’s production-ready. - Merge the
releasebranch intomain: Once the release is ready, merge thereleasebranch into the main branch and tag it with a version number. Use a pull request to ensure code reviews and approval from other team members.
Hotfixes
If a critical issue in the main branch is detected:
- Create a
hotfixbranch frommain: This branch is used to quickly fix critical issues or bugs in the production code that cannot wait for the next release cycle. - Merge the
hotfixbranch into bothdevandmain: After the hotfix is completed and tested, it is merged into both thedevandmainbranches to ensure that the fix is applied to both the ongoing development work and the production code.
Naming Conventions
While names aren't strictly enforced, we recommend the following naming conventions for branches:
- Features Branches:
feature/nameorissueNumber-issueTitle - Release Branches:
release/version - Hotfix Branches:
hotfix/name
GitHub provides a convenient way to create new branches for issues from the repository's web interface. When you select an issue, the right sidebar will display a button to create a new branch with the issue name.