Introduction
First of all, this documentation is a summary of https://docs.gitlab.com/ee/topics/gitlab_flow.html
Structure

With this flow we use only main, feature, fix and release branches and totally remove develop branch unlike in gitflow
Pre-commit
This project uses pre-commit. It is optional. For more information, read the official documentation.
How to add feature or fix
In this flow, all feature or fix branches must be based on main branch and merged after review on main branch
How to add hotfix
We have to identify the type of hotfix:
- hotfix for both current version and released versions
- hotfix for specific release
Hotfix for all versions
In this case you should create a commit with the same flow as fix flow.
And after merge, you should cherry-pick merge commit on release branch.
Hotfix for specific version
This case is simplier, you can create branch from release branch and merge it in release branch.
How to deploy
We have identified two type of deployment:
- Non production environment
- Production environment
Deploy on non production environment
Non production deployments are run on main branch.
Deploy on production environment
To launch deployment on production environment, you need to tag your repository.
Updating the changelog
Every new feature, bugfix, chore task, etc... should result in a new entry in the changelog file. The convention of this file is strongly inspired from the Keep a Changelog standard.
An Unreleased section should always be present at file top. In every new merge request, add your modifications in the Unreleased section with the appropriate sub-section:
Addedfor new features.Changedfor changes in existing functionality. Add the BREAKING tag at the beginning of lines including a breaking change.Deprecatedfor soon-to-be removed features.Removedfor now removed features.Fixedfor any bug fixes.Securityin case of vulnerabilities.
The developer releasing the version is responsible for the update of the Unreleased section. They must follow those steps just after having created the version tag:
- Rename
Unreleasedto<tag version> / <release date: YYYY-MM-DD> - Create the new
Unreleasedsection