Git Flow Strategies
Git Flow Strategies
A branching strategy is the strategy the software development team adopts when writing, merging and deploying code using a
version control system. ( eg. Bitbucket, Github )
The git flow strategy is implemented in the Continous Integration and Continous Delivery (CI/CD) flow from the application repositories.
The commit messages must follow Conventional Commits specification. Conventional commits is a specification for adding human and
machine-readable meaning to commit messages.
Branches are a part of everyday development. A git branch is a movable pointer to a commit, allowing us to have a snapshot of our
changes. When we want to add new functionalities or fix bugs, we create new branches to encapsulate our changes before being
merged into stable environments.
Naming convention:
1 [branch-type]/[issue-identifier]-[issue-title]
feature/CSS-2-integrate-dependabot
The issue identifier usually represents the task ID from Jira or other task management tools.
Branch types
Supporting Branches
They are used in git flows to work on new functionalities, fix bugs, and improve code structure and settings.
feature/[issue-id]-[issue-title]
The feature branches are used to work on a new feature for one of the upcoming releases.
chore/[issue-id]-[issue-title]
The chore branches are used for working on tasks that do not add a new feature to the codebase. They are used for tasks that update the
code structure, configurations, pipelines, or other non-functionality-related tasks.
bugfix/[issue-id]-[issue-title]
The bugfix branches are used to work on fixing a bug that appeared on the project. These branches are used to fix bugs that are allowed
to enter one of the upcoming releases and they do not need to be merged directly into the production branch after finishing the fix. If the fix
needs to be entered ASAP in the production branch without waiting for the next release, a hotfix branch must be used.
hotfix/[issue-id]-[issue-title]
The hotfix branches are used for working on bug fixes that need to reach the production environment before the next release happens.
They are created when there is a critical bug that blocks important functionalities for the application. As soon as the bug is fixed, the branch
reaches the production branch without waiting for the next release.
Main Branches
They are used to reflect different application environments and the code that reaches these branches needs to be stable. Depending on the
flow, there are multiple points where the added functionalities are tested to ensure the stability of the code.
Git Flow
DEVELOPMENT
The development branch is used as the main branch. The branch is kept up to date with the active release branch and represents the
place from where we create new RELEASE/X.Y.Z branches.
Pull Request source: No PRs are required from the main branches.
RELEASE/X.Y.Z
The release branches are used for keeping all the code for the upcoming release. The release with the lowest version is considered the
active release, the others are considered inactive release branches. Once merged the branch is deleted.
STAGING
The branch is used as the environment where the next release is tested before reaching a production-ready state and where regression
testing is done to ensure the stability of the system.
This branch is usually skipped in smaller projects where we do not have to do a regression. In those cases, we push the code
from the release branches directly into the master branch.
MASTER
The master branch reflects the production environment. When a release is stable and goes through all the testing steps, it is merged into
the master branch. When the code reaches the master branch, a new release tag is created with the active release version.
After the active release code is available on this branch, the active release branch needs to be deleted. In this way, the next
release branch will be automatically considered the active release