Skip to content
IT glossary
ProgrammingUpdated December 3, 2026

Git Flow

This Git branching model separates shipped code from work on future versions. It uses dedicated branches to stabilize a release or patch a version that is already in use.

Also known as: trunk-based development, стратегия ветвления

What Git Flow solves

Suppose you're testing next week's release, but the team is already writing code for the one after it. Git Flow gives the release under test its own branch so that new work doesn't change what testers are checking. It also gives the team a way to patch the shipped version without bringing along unreleased features. The model is a set of conventions, not a Git feature or a requirement to install a git flow tool.

Where changes go

There are two long-lived branches. main, called master in the original model, records shipped versions, with tags identifying individual releases. develop is where changes come together for future releases. Three kinds of temporary branch handle the work in between:

  • Feature branches start from develop and merge back into it. A feature/ prefix makes their purpose easy to see but doesn't change how Git works.
  • Release branches start from develop once the scope of an upcoming release is set. They receive stabilization fixes and version updates, while new feature work continues on develop. To finish the release, merge into main, tag the release commit, and merge the release changes back into develop.
  • Hotfix branches start from main to patch a shipped version. The fix goes into main for a patch release and must also reach future releases. In the classic workflow, if a release branch is already open, merge the fix there instead of directly into develop; it reaches develop when that release is finished.

Example: patching production mid-release

Version 2.3.0 is live and release/2.4.0 is under test. A production bug prevents users from saving a draft. The team fixes it on hotfix/2.3.1 from main, merges it back, and tags v2.3.1 for the patch release. It also merges the fix into release/2.4.0 so testers can verify it there. Starting the patch from develop could have pulled in features that weren't ready to ship; fixing only main could have let the bug return in 2.4.0.

When to choose it

Git Flow can make sense for scheduled, versioned releases that need a separate testing window, such as a desktop application distributed to customers. The trade-off is more merging and more chances for branches to diverge. A release tag identifies a commit; building and deploying it are separate steps that a CI/CD pipeline can automate.

Git Flow is not trunk-based development. In trunk-based development, engineers integrate small changes into one main branch frequently, either directly or through short-lived branches. For a service that deploys many times a day, that usually means fewer handoffs between branches. Feature flags can keep unfinished functionality unavailable even after its code is merged.

How it comes up in interviews

You may be asked where to branch for a production fix and how to stop the next release from reintroducing the bug. Walk through both paths: getting the fix into the shipped version and carrying it forward into ongoing work. If you're asked to pick a workflow, explain how release frequency and the need for a separate stabilization period affect your choice.