Web apps & software

What is a feature branch?

A feature branch is a copy of the codebase in version control where a developer builds one feature or fix in isolation, then merges it back into the main branch once it has been reviewed and tested.

How it flows

A developer creates a branch such as feature/wallet-top-up from main, commits work there, pushes it, and opens a pull request. Main stays stable because unfinished work is not mixed in. Several people can build different features at once without stepping on each other.

Naming

Prefix by type and add a ticket number, like fix/2231-invoice-rounding. Consistent names make the list of branches readable and let tools link them to tasks.

The key rule: keep it short

The longer a branch lives, the more it diverges from main and the harder the merge. Aim for days, not weeks. If a feature is large, break it into pieces that can be merged separately, hiding unfinished parts behind a feature flag.

Housekeeping

Delete branches after merging, protect main so nobody pushes straight to it, and require review. Teams practicing trunk-based development use even shorter branches.

Questions, answered

No. A branch lives inside one repository; a fork is a separate copy of the whole repository.

To a preview or staging environment, yes. Production should deploy from the reviewed main branch.

By the Stegnor team · Updated