← Back to list
SW Engineering & Management
#브랜치전략#GitFlow#GitHubFlow#트렁크기반개발#CICD
Last updated · 2026-11-21

Git Branching Strategy — GitFlow, GitHub Flow, Trunk-Based Development

1. Overview

A. Definition

A branching strategy is a team's shared set of rules governing, when many developers collaborate on a single Git repository, when to create branches, how to integrate (merge) them, and when to ship them as releases (deploy). It standardizes the flow of isolating, integrating, and releasing code changes so as to reduce conflicts and quality degradation and to stabilize the deployment rhythm — an operational rule of configuration management.

Git is a distributed version control system (DVCS) in which the cost of creating and merging branches is nearly zero, so technically anyone can freely create a branch. But "what is technically possible" and "what is good for a team to operate together" are different things. When everyone creates branches without agreement, integration points scatter, and big-bang merges — belatedly merging branches that have diverged by hundreds of commits — and large-scale conflicts recur. To prevent this chaos, a branching strategy fixes, as a convention, which branch is the "always-deployable truth (main)" and which is the "work in progress (working)," and at what cadence changes are integrated.

A branching strategy is not merely a way of using Git but a software engineering decision intertwined with release cadence, quality gates, and organizational structure. An organization that ships releases as quarterly packages and a SaaS organization that deploys dozens of times a day must choose different strategies. Therefore, from a professional engineer's perspective, a branching strategy is not "one correct answer" but a trade-off design problem that takes the team's deployment frequency, test automation maturity, and regulatory requirements as inputs.

B. Background and Necessity

In early centralized version control (CVS, SVN), the cost of branching was high, so people often committed directly to the trunk (the main development line), tagging only at release time. When Git appeared in 2005 and a branch became essentially "just a pointer to a commit" — making creation, switching, and merging instantaneous — a culture of freely splitting branches by feature spread. This freedom brought the advantage of isolation, but it simultaneously amplified the cost of delayed integration: the longer integration is postponed, the greater the risk of conflicts and regressions.

Meanwhile, as DevOps and CI/CD became widespread after the 2010s, the core metric of software delivery shifted to "how often and how safely do you deploy?" DORA (DevOps Research and Assessment) studies proposed Deployment Frequency, Lead Time for Changes, Change Failure Rate, and Time to Restore as key metrics, and showed that higher-performing organizations integrate in smaller batches, more frequently. The longer a branch lives, the further it drifts from main and the harder it is to integrate, so a branching strategy became a question of "how much do we want to delay integration?"

For example, an organization like a next-generation financial system that needs quarterly scheduled releases and strict change control fits a strategy that explicitly operates release branches, whereas large SaaS firms like Coupang or Toss choose strategies that drastically shorten branch lifetimes to achieve hundreds of deployments a day. Thus an organization's deployment model and branching strategy are inseparable, and a wrong pairing leads directly to deployment bottlenecks and increased incidents.

2. Components of a Branching Strategy and Overall Structure

To compare the strategies, one must first understand the common axes they all share. The key axes are: ① the meaning of the main branch (is it always deployable?), ② branch lifetime (how many days does it live?), ③ integration cadence (how often do we merge into main?), and ④ whether releases are separated (do we split deployment into a dedicated branch?). The combination of these axes determines the character of each strategy.

graph TD
  subgraph CORE["Common Axes of Branching Strategies"]
    A["Main branch: always-deployable truth"]
    B["Branch lifetime: shorter is easier to integrate"]
    C["Integration cadence: small and often vs large and rare"]
    D["Release separation: with or without release branch"]
  end
  A --> E["Strategy choice"]
  B --> E
  C --> E
  D --> E
  E --> F["GitFlow: release-centric, multiple long-lived branches"]
  E --> G["GitHub Flow: single main, short feature branches"]
  E --> H["Trunk-based: direct to main, ultra-short branches"]
  F --> I["Deployment pipeline CI/CD"]
  G --> I
  H --> I

As the structure diagram shows, the three representative strategies are the result of choosing different points on the same four axes. GitFlow strongly enforces release separation at the cost of long branch lifetimes, whereas trunk-based development drastically shortens lifetimes to eliminate integration delay, relying heavily on automated quality gates instead. GitHub Flow sits in between, offering a simple balance point of "one main + short feature branches + PR review."

A. GitFlow — Release-Centric, Multiple Long-Lived Branches

GitFlow is a model proposed by Vincent Driessen in 2010 that maintains two permanent branches, main (or master) and develop, with purpose-specific auxiliary branches — feature, release, and hotfix — between them. Developers branch a feature off develop, work on it, and merge it back into develop when done. When preparing a release, they branch a release off develop and do bug fixes and version finalization only there; when complete, they merge into both main and develop and tag the version on main.

The strength of this structure is the explicit separation of a release-stabilization space. While a release branch is alive, development of the next version's features continues on develop, so "release preparation" and "next development" do not block each other. When an urgent defect appears in production, a hotfix branch is cut directly off main, fixed, and reflected into both main and develop, allowing emergency patches without waiting for the formal release cycle. Because versions remain clearly as tags and the release history is preserved linearly, it fits packaged software and enterprises or financial institutions doing quarterly releases.

Its weaknesses are also clear. With two permanent branches and three kinds of auxiliary branches running simultaneously, the flow is complex and the learning curve steep, and feature branches living for days or weeks diverge from develop, inflating merge conflicts. Especially in continuous delivery (CD) environments that deploy multiple times a day, the multi-stage merge of develop→release→main instead becomes a bottleneck that slows deployment. The creator of GitFlow himself stated in a 2020 note that "for products delivered continuously, such as web applications, GitFlow is overkill, and I recommend a simpler flow like trunk-based."

B. GitHub Flow — A Lightweight Strategy with a Single main

GitHub Flow is an extremely simple model that GitHub codified for its own operations, with only one permanent branch: main. The rules can be summarized in six: ① main must always be deployable, ② work is done on short, descriptively named branches cut off main, ③ commit and push frequently, ④ open a Pull Request (PR) when done, ⑤ merge into main after review and automated tests pass, and ⑥ deploy immediately upon merge.

The core value of GitHub Flow is simplicity and review-centric quality management. Without intermediate layers like develop or release, even a new hire can learn the flow in a day, and since every change goes through a PR, code review and CI become natural quality gates. Because feature branches live at most a few days, they do not diverge much from main, so integration conflicts are small, and the flow of deploying upon merge fits SaaS and web services well. Large web services like GitHub and Shopify operate variants of this approach.

However, since GitHub Flow presupposes "one main = deployable," it is insufficient for packaged products that must support multiple versions simultaneously (e.g., maintaining v2 while developing v3) or organizations with complex environment-based (staging/production) promotion procedures. Also, to deploy immediately upon merge, automated tests, rollback, and feature flags must be in place; applying it without these safeguards easily breaks main. To compensate, the GitLab Flow variant emerged, adding environment branches (staging, production); it is a compromise that layers release and environment-promotion concepts onto GitHub Flow's simplicity.

C. Trunk-Based Development — Ultra-Short Branches and Continuous Integration

Trunk-Based Development (TBD) is a strategy in which all developers work around a single trunk (= main), and either create no branches at all or merge them within a day even when they do. By splitting changes small and integrating them directly into main several times a day, it most faithfully implements the original definition of continuous integration (CI): "every developer integrates into the mainline at least once a day." The monorepos of hyperscale organizations like Google and Meta use this approach.

The essential benefit of TBD is the elimination of integration-delay cost. Since a branch lives at most a few hours, there is no gap to diverge from main, so merge conflicts are structurally small, and every change is shared immediately, reducing "works on my machine" integration errors. Unfinished features are merged in a code-disabled state via feature flags/toggles and then released simply by flipping the flag when ready, separating deployment from release. This lets code integration happen daily while user exposure is controlled separately, raising deployment frequency and stability at the same time.

However, TBD presupposes a strong automated safety net. At every integration, reliable automated tests, static analysis, and builds must run within seconds to minutes to protect main, and review must also happen quickly without PR waits, requiring pair programming or a small-PR culture. If an organization with low test-automation maturity adopts TBD, a broken main halts the entire team's work — a counterproductive effect. Also, as feature flags needed to put unfinished code into main pile up, code complexity and "flag debt" accumulate, so promptly removing flags once used is essential.

3. Detailed Integration/Release Flow Architecture

The difference among the three strategies becomes sharper when viewed on the time axis of "integration delay." The flow diagram below contrasts, by strategy, the path from a feature branch being created, integrated into main, and shipped as a release.

flowchart LR
  subgraph GF["GitFlow"]
    gf1["feature"] --> gf2["develop"]
    gf2 --> gf3["release"]
    gf3 --> gf4["main + tag"]
    gf4 -.hotfix.-> gf2
  end
  subgraph GH["GitHub Flow"]
    gh1["short feature"] --> gh2["PR review + CI"]
    gh2 --> gh3["main"]
    gh3 --> gh4["deploy immediately"]
  end
  subgraph TB["Trunk-based"]
    tb1["ultra-short branch(<1 day)"] --> tb2["main(trunk)"]
    tb2 --> tb3["release control via feature flags"]
    tb3 --> tb4["continuous deployment"]
  end

In GitFlow, a change passes four gates — feature→develop→release→main — before reaching users, so stability is high but lead time is long. GitHub Flow reduces this to two stages, feature→main, greatly shortening lead time while using PR review and CI as quality gates. Trunk-based pulls integration to almost real time and moves release control from branches to feature flags, implementing "integration ≠ release." In other words, the difference among the three strategies is essentially "where do you trade stability (number of gates) for speed (lead time)?"

The choice of merge method also affects flow quality. A merge commit preserves branch history as-is, giving good traceability but complicating the graph; a squash merge compresses a feature unit into a single commit, keeping the main history clean and pairing well with TBD and GitHub Flow. A rebase creates linear history but tangles history if used on shared branches, so the principle is to limit it to local cleanup.

4. Comparison and Selection Criteria

The three strategies should be evaluated not as a ranking but by their fit to an organization's situation. The table below summarizes the differences on the key axes, and after the table we explain "why those differences arise."

Category GitFlow GitHub Flow Trunk-based (TBD)
Permanent branches main + develop main main (trunk)
Branch lifetime days to weeks hours to days hours (<1 day)
Integration cadence slow (release-centric) fast very fast (hours)
Release control release branch merge = deploy feature flags
Prerequisites scheduled-release discipline PR review, CI high-maturity automation, flags
Best-fit domain packaged, financial, regulated web, SaaS, small teams large-scale CD, monorepo
Key risk complexity, integration delay weak multi-version support broken main, flag debt

The root of these differences lies in "what do you gain in exchange for delaying integration?" GitFlow bundles integration into release units and thereby delays it, in exchange for a pre-release stabilization space and clear version history. Hence it fits finance, public sector, and embedded firmware where each deployment has large user impact. Conversely, TBD makes integration delay nearly zero to maximize lead time and deployment frequency, in exchange for handing quality responsibility to an automated pipeline rather than people. Hence it pays off only in organizations with high test coverage and mature rollback and flags. GitHub Flow offers a pragmatic balance between the two: "let a small team move fast, but keep PR review as a human gate."

As a real-world example, a next-generation project at a domestic (Korean) financial public institution required quarterly releases and audit trails, so it used a GitFlow variant but handled emergency security patches via the hotfix path, shortening mean time to restore. In contrast, service organizations like Toss and Baedal Minjok combine a near-trunk-based flow with feature flags and canary deployment to achieve dozens to hundreds of deployments a day, lowering change failure rate while raising deployment frequency. In short, even with the same Git, "safely once a quarter" and "safely hundreds of times a day" demand entirely different branching strategies.

5. Deep Dive — Linkage with CI/CD and DORA Metrics, and Recent Trends

A branching strategy cannot be discussed apart from the CI/CD pipeline, deployment strategy, and organizational metrics. From the perspective of DORA's four metrics, the shorter the branch lifetime, the more clearly the trend is toward reduced change lead time and higher deployment frequency. The Accelerate research and subsequent State of DevOps reports repeatedly pointed out that long-lived branches and long PR waits are major causes of increased lead time, and prescribed, as the remedy, small batch sizes and short branches — a flow close to trunk-based.

A recent trend is toward "replacing the work that branches used to isolate with other mechanisms." First, feature flags have become widespread, managing unfinished features as runtime toggles rather than branches, separating integration from release. Second, with the diversification of deployment strategies, blue-green, canary, and progressive rollout are combined so that, even after merging into main, traffic is opened in stages to control risk (see [[deployment-testing-strategy]]). Third, stacked PRs (stacked diffs) and merge-queue tools have emerged, helping split a large change into a chain of small PRs for review while maintaining TBD's short integration cadence. Fourth, in platform engineering and GitOps flows, Git branches/tags become the "single source of truth" for deployment state, so the branching strategy now determines the structure of the deployment declaration itself.

Likely exam directions include: ① describing the comparison of the three strategies and the selection criteria by organization, ② the relationship between trunk-based development and feature flags/CI, ③ the linkage between branching strategy and DORA metrics/DevOps performance, and ④ the interaction of monorepo/multirepo with branching strategy. When composing answers, rather than merely listing terms, developing them around the causal chain — "the demand for deployment frequency pressures branch lifetimes to shorten, and short lifetimes in turn demand automation and flags" — demonstrates the depth expected of a professional engineer.

6. Considerations and Implications

The considerations a professional engineer should address in selecting and operating a branching strategy are as follows.

  • Fit first, reject fads: Adopting trunk-based development just because "Google uses it" fails. Google can do so only on the premise of tens of thousands of automated tests and in-house build infrastructure. One must first diagnose one's own test-automation maturity, deployment frequency, and regulatory requirements, then choose a fitting strategy or migrate gradually.
  • Strategy is not fixed but an evolution path: Many organizations start with GitFlow and, as automation matures, shorten lifetimes toward GitHub Flow → trunk-based. Rather than changing all at once, it is realistic to design a roadmap that gradually pulls in the integration cadence — setting branch-lifetime caps, limiting PR size, introducing merge queues.
  • Joint investment with automation and safety nets: The shorter the branch lifetime, the more quality responsibility shifts to automation, so one must jointly invest in reliable CI, test coverage, rollback, feature flags, and observability. Pulling in the integration cadence without a safety net raises the incident rate.
  • Managing feature-flag debt: Feature flags, the core tool of trunk-based, when accumulated, cause code complexity and a combinatorial explosion of test combinations. Governance is needed to manage the flag lifecycle (create, measure, remove) and to periodically clear out flags that have served their purpose.
  • Harmony with regulatory and audit traceability: In domains like finance and the public sector that require change control and audits, to satisfy both fast integration and traceability, one must design PR-approval records, tag-based releases, and change-management linkage. It is advisable to operate this in combination with the baseline and change-control perspective of [[configuration-management]].
  • Alignment with organizational and collaboration culture: A strategy is not a tool but a consensus. Unless a culture of small PRs, fast reviews, and pair programming backs it, any strategy runs idle. Along with introducing a strategy, one should document review SLAs, branch-naming rules, and merge policies so the whole team shares the same rhythm.

References


In one line: A branching strategy is a set of rules for creating, integrating, and releasing branches, in which GitFlow (release-centric, long-lived branches), GitHub Flow (single main, short branches), and trunk-based development (ultra-short branches, feature flags) trade "stability versus deployment speed" at different points, so one must choose according to the organization's deployment frequency, automation maturity, and regulatory requirements and gradually pull in the integration cadence.