Repository Rules
Branching strategy
Main Branches
main
: This branch contains the stable, production-ready code. Only thoroughly tested and approved changes are merged here.dev
: This is the integration branch for features and fixes. All new development work is merged here before it goes tomain
.
Supporting Branches
Feature Branches: Used for developing new features. These branches are created from
dev
and merged back intodev
once the feature is complete.Naming convention:
feature/feature-name
Bugfix Branches: Used for fixing bugs. These branches are also created from
dev
and merged back intodev
after the fix.Naming convention:
bugfix/bug-name
Release Branches: When preparing for a new release, a release branch is created from
dev
. This branch is used for final testing and minor bug fixes before merging intomain
.Naming convention:
release/x.y.z
Hotfix Branches: For critical fixes that need to be applied to the production code immediately. These branches are created from
main
and merged back into bothmain
anddev
.Naming convention:
hotfix/x.y.z
Workflow Example
Feature Development
Create a feature branch from
dev
:git checkout -b feature/new-feature dev
Develop the feature and commit changes.
Merge the feature branch back into
dev
:git checkout dev && git merge feature/new-feature
Delete the feature branch:
git branch -d feature/new-feature
Release Preparation
Create a release branch from
dev
:git checkout -b release/1.0.0 dev
Perform final testing and bug fixes.
Merge the release branch into
main
:git checkout main && git merge release/1.0.0
Tag the release:
git tag -a v1.0.0 -m "Release 1.0.0"
Merge the release branch back into
dev
:git checkout dev && git merge release/1.0.0
Delete the release branch:
git branch -d release/1.0.0
Hotfix
Create a hotfix branch from
main
:git checkout -b hotfix/1.0.1 main
Apply the hotfix and commit changes.
Merge the hotfix branch into
main
:git checkout main && git merge hotfix/1.0.1
Tag the hotfix:
git tag -a v1.0.1 -m "Hotfix 1.0.1"
Merge the hotfix branch into
dev
:git checkout dev && git merge hotfix/1.0.1
Delete the hotfix branch:
git branch -d hotfix/1.0.1
Merge Requests
Merge request must follow the Conventional Commits naming rules.