Skip to main content

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

  1. Create feature branches: When starting work on a new feature or bug fix, create a new feature branch from the dev branch.
  2. Develop and merge the feature branch into dev: Make any necessary changes to your local code on the feature branch. Once the feature is complete and tested, merge the branch back into the dev branch.

Release Management

  1. Create the release branch: When it’s time to prepare a new release, create a new release branch from the dev branch 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.
  2. Merge the release branch into main: Once the release is ready, merge the release branch 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:

  1. Create a hotfix branch from main: This branch is used to quickly fix critical issues or bugs in the production code that cannot wait for the next release cycle.
  2. Merge the hotfix branch into both dev and main: After the hotfix is completed and tested, it is merged into both the dev and main branches 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/name or issueNumber-issueTitle
  • Release Branches: release/version
  • Hotfix Branches: hotfix/name
tip

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.