Feature branch
A feature branch is a Git branch that diverges from the main line for the duration of a single feature's development, with all that work isolated from main until the feature is complete and merged via pull request. Feature branches are the opposite of trunk-based development, where every commit lands on main behind a flag.
Feature branching is the traditional default for teams that aren't yet practising continuous integration. The trade-offs: long-lived feature branches accumulate merge debt (the main line has drifted), reduce visibility of in-progress work, and force a 'merge day' that's often the source of integration bugs. Short-lived feature branches (lifespan 1-3 days, scoped tightly) approach the benefits of trunk-based development while keeping the PR-review workflow. The signal a team has outgrown feature branching: PRs routinely sit open for >5 days, merge conflicts are common, integration tests find bugs nobody attributed to a specific PR.
Related terms
- Trunk-based development
Trunk-based development is a source-control workflow where engineers integrate small changes to a single shared branch (trunk / main) at least once per day, gated by automated tests and feature flags rather than long-lived branches.
- Pull request
A pull request (PR) — also called a merge request in GitLab / Bitbucket — is a proposal to merge changes from one git branch into another, typically with code review and CI checks gating the merge.
- Gitflow
Gitflow is a branching model with long-lived develop and main branches, plus feature, release, and hotfix branches.