Fundamentals 8 min read

Understanding Git Flow, Github Flow, and Gitlab Flow: Feature‑Driven Development Workflows

This article explains three widely used Git workflows—Git flow, Github flow, and Gitlab flow—highlighting their feature‑driven development model, branch structures, step‑by‑step processes, advantages, drawbacks, and practical tips such as pull requests, protected branches, and commit squashing.

Architecture Digest
Architecture Digest
Architecture Digest
Understanding Git Flow, Github Flow, and Gitlab Flow: Feature‑Driven Development Workflows

Git, as a source‑code management system, inevitably involves multi‑person collaboration, which requires a standardized workflow to keep projects organized and moving smoothly.

The article introduces three popular workflows: Git flow, Github flow, and Gitlab flow, all based on feature‑driven development (FDD), where requirements drive the creation of feature or hotfix branches that are merged into the main branch and then deleted.

Git flow is the earliest and most widely adopted workflow. It uses two long‑term branches— master for stable releases and develop for daily development—and three short‑term branches (feature, hotfix, release). After development, short‑term branches are merged into develop or master and deleted. Its strengths are clear control; its weaknesses are complexity and the need for two long‑term branches, which may be unnecessary for continuously deployed projects.

Github flow simplifies Git flow for continuous deployment. It has a single long‑term branch ( master ) and follows four steps: create a branch from master , open a pull request (PR), discuss and iterate on the PR, then merge the PR into master and delete the branch. It works well when the master branch always reflects the live code, but may require an additional production branch for environments where deployment lags behind merges.

Gitlab flow combines the advantages of Git flow and Github flow. It follows the “upstream first” principle, keeping only one main branch ( master ) as the upstream for all other branches. For continuous deployment, it recommends separate environment branches (e.g., pre‑production , production ) that track upstream changes. For versioned releases, stable branches (e.g., 2‑3‑stable ) are created from master for bug‑fixes only.

The article also offers practical tips: use Pull Requests (or Merge Requests) for code review, protect the master branch, manage work with Issues, prefer non‑fast‑forward merges to keep commit history clear, and squash multiple commits before opening a PR to simplify review.

Images illustrating branch structures and processes are included throughout the article.

Workflowgitversion controlgit flowGitHub FlowGitLab Flowfeature-driven development
Architecture Digest
Written by

Architecture Digest

Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.