Table of Contents

Feature branch

Feature branch is a git branch created for developing a single feature separately from main. Work proceeds in isolation, code is reviewed in a pull request, then merged back once approved.

Incomplete features on main force other developers to deal with broken or hidden code. Longer branches (weeks old) diverge further from main, accumulating conflicts and making review harder. Every day a branch exists increases integration risk.

The benefit is isolation: main stays releasable and incomplete features do not interfere with other work. The cost is delayed integration. Short-lived branches (one to three days) work best. Trunk-based development is the alternative: commit directly to main, hiding incomplete features behind feature flags instead.

The diagram shows feature work branching from main, proceeding in isolation, then being code-reviewed in a pull request before merging back.

main:  o---o---o (stable, releasable)
        \
feature: o--o--o (isolated development)
          \
           o (pull request, code review)
            \
             o---o (merged after approval)
main:  o---o---o---o (feature integrated)