my-git

GitLab Flow

English 中文

Original links:

GitLab Flow sits between GitHub Flow and Gitflow.

It retains the lightweight collaboration style of feature branches and merge requests while introducing concepts like production branches and stable branches, making it suitable for teams needing environment, production, or stable release branches.

What Problems Does It Solve?

GitHub Flow is very lightweight and suited for teams whose main branch is always deployable.

Gitflow has comprehensive branch roles but is too heavy for many Web / SaaS teams.

GitLab Flow fits the middle ground:

Common Forms

Production branch

feature/* -> main -> production

main receives daily integrations, while production represents the state already deployed to production.

Suitable for:

Stable branch

main -> stable/1.0
main -> stable/1.1

Stable branches represent version lines requiring long-term maintenance.

Suitable for:

Differences from Other Models

Model Core Features
GitHub Flow Lightest, centers around default branch and PRs
GitLab Flow Adds production / stable branches on top of lightweight MR flows
Gitflow Most comprehensive branch roles, heaviest process
Trunk-Based Development Emphasizes frequent mainline integration, short branches, and rapid validation

Which Teams Is It Suitable For?

Suitable for:

Not suitable for:

Implementation Advice

  1. Clarify the semantics of main and production first
  2. All changes still go through MRs / PRs
  3. The production branch only receives validated changes
  4. Stable branches only receive hotfixes for their respective versions
  5. Use tags and release notes to document versions post-release
  6. Hotfixes must be synced back to the mainline to avoid losing fixes

Extended Reading