Updated on 2026-01-28 GMT+08:00

GitFlow

Overview

Git Flow is a set of industrial branch management standards. It defines types of branches and flow rules that everyone in medium and large projects can follow. For each branch type, its function, and flow logic, see the following table.

Table 1 Git Flow branches

Branch Type

Source

Function

Naming Convention

Merge Target

Lifecycle

master

Automatically created upon repository initialization

Stores stable code of the production environment and is bound to the formal version tag.

master

release/hotfix

Permanent, that is, the branch exists during the project period.

develop

master

Serves as the main development branch. It integrates completed functions and stores code to be released.

  • Abbreviation: dev
  • Full spelling: development
  • With environment identifiers (This naming convention applies only to complex scenarios involving multiple environments. It is not recommended for common projects because it will make the names more difficult to understand.):
    • develop-dev: main branch in the development environment
    • develop-test: main branch in the test environment

feature/release

Permanent

feature

develop

Used to develop a new feature. Only code to be modified and related to the feature is involved.

  • Basic format: feature/function description. For example, feature/ure-login indicates the feature of user login.
  • ID format of an associated requirement: feature/issueID-function description. For example, feature/123-user-avatar-upload indicates the 123 requirement for fixing the feature of uploading user avatar.

develop

Temporary and will be deleted after the feature is merged.

release

develop

Prepared for version release. This branch is only used to fix bugs found during testing, and does not allow adding of new code of features.

NOTE:

A version number starts with the prefix v (short for version), followed by major version number, minor version number, and revision number in order.

  • Official version release:
    • release/v1.0.0: for an official version
    • release/v2.1.0: prepared for the 2.1.0 official release with new features.
  • Patch version release: release/v1.0.1 indicates the release branch of patch 1.0.1 that has the bugs in 1.0.0 fixed.

master+develop

Temporary and will be deleted after the version is released.

hotfix

master

Used for quick fixing of bugs in the production environment. This branch is prior to the feature branch.

  • Directly describe the issue. For example, hotfix/user-data-display-error indicates a hotfix branch for fixing the user data display error.
  • Include a version number for tracing issues. For example, hotfix/v1.0.1-user-data-display-error indicates a hotfix branch for fixing the user data display error found in version 1.0.1.

master+develop

Temporary and will be deleted after the bug fixes are merged.

Advantages

  • Clear structure and standard process

    Git Flow organizes branches by clear roles: master (for production), develop, feature, release, and hotfix (for urgent bug fixes). It is a logical workflow that reduces confusion and helps keep the team's development process aligned.

  • Better isolation and lower risks
    • Developing new features in feature branches does not affect the develop branch.
    • Testing and fixing in release branches before version release avoids interference with daily development.
    • Fixing bugs in the production environment through hotfix branches does not interrupt the normal development process.
  • Clear versioning and strong traceability
    • Binding the master branch with version tags (for example, v1.0.0) facilitates quick locating of production code.
    • Clear branch names and merge records make it easy to trace code commit and fixes, facilitating troubleshooting.
  • Applicable to medium and large projects and long-term maintenance

    For projects with long iterations, large teams, and continuous maintenance, the strict Git Flow workflow ensures smooth collaboration, reducing code conflicts and release risks.

Disadvantages

  • Not flexible enough for quick iterations

    For agile and continuous deployment projects, release branches may slow down the release pace. Iterations, for example, of small functions, have to go through the whole process from feature to develop, release, and master.

  • Complex process and high learning cost
    • It may take a long time for beginners to master the branch types, sources, target branches to merge to, and lifecycles.
    • In routine operations, there are many steps for creating, merging, and deleting branches, which increases management costs.
  • Redundant branches and high maintenance cost

    Branches will pile up and become difficult to manage if the temporary branches (such as feature, release, and hotfix) are not cleared up in time, especially in long-term projects.

  • Not suitable for small projects or teams of 3 to 5 members

    For small teams or short-term projects, the strict Git Flow process can be overly complex. Using just master and develop branches is usually sufficient.