Kelly Mears

Branching Model

The convention governing what branches exist, what they mean, and how work reaches production.

Version Control & Delivery1 min read191 words15 out · 13 in
also calledBranching strategy

A branching model is the agreed answer to what branches a project has, what each means, and how a change travels from a working copy to production. It is a social convention rather than a technical constraint — the tool permits nearly anything.

The main families are long-lived release branches with staged promotion, which suit software shipped in versions to customers who upgrade on their own schedule; and Trunk-Based Development, where everything merges to one integration branch continuously, which suits software deployed constantly.

What matters more than the choice is that the model is stated and current. A stale model is a specific and expensive hazard: documentation naming an integration branch that has since been superseded sends people to branch from something that no longer receives changes, and the resulting work merges badly or not at all. When an integration branch changes, every reference to it — documentation, tooling configuration, continuous-integration conditions — has to change too, and the ones that do not fail quietly. See Documentation Rot and Silent Failure.

The model also determines what a merge means and therefore what history looks like; see Squash Merge and Merge Train.

See also10

Semantic Conflict

Two changes that merge cleanly and are incompatible in meaning.

Version Control & Delivery15 connections

Pull Request

A proposal to merge a branch, carrying review, automated checks, and the discussion around it.

Version Control & Delivery25 connections

Continuous Integration

Automatically building and testing every change, so integration problems surface immediately.

Version Control & Delivery38 connections

Version Control

A system recording the history of a project's files, enabling branching, merging, and recovery.

Version Control & Delivery26 connections

Three-Way Merge

Combining two lines of work by comparing both against their common ancestor.

Version Control & Delivery17 connections

Hotfix

An urgent fix shipped outside the normal release flow, how teams branch and backport it, and why the healthiest hotfix process is the normal process run fast.

Version Control & Delivery6 connections

Detached HEAD

The Git state in which the current checkout points directly at a commit rather than a branch, harmless for looking around but a trap for new work, since commits made there belong to no branch and can quietly disappear.

Version Control & Delivery11 connections

Cherry-Pick

Copying the change from one commit onto another branch as a new commit, the standard way to backport a fix without merging everything else that came with it.

Version Control & Delivery15 connections

Release Train

Shipping on a fixed schedule whether or not a given feature is ready, so features that miss one release simply wait for the next instead of holding everyone back.

Version Control & Delivery13 connections

Fast-Forward Merge

The two basic ways Git joins branches, by sliding a branch pointer forward or by recording a new commit with two parents, and how the choice shapes a project's history.

Version Control & Delivery14 connections

Linked from13