I wrote the book on developer marketing. Literally. Picks and Shovels hit #1 on Amazon.

Get your copy
Engineering and DevOps

Branch

branch

A parallel version of the code that lets developers work on changes without affecting the main codebase.

A branch is a parallel copy of the codebase where a developer can make changes without affecting the main code. When the changes are ready, the branch is merged back into the main branch. This is the fundamental workflow of modern software development.

The main branch (historically called "master," now usually "main") is the production-ready code. Feature branches are created for new work: a bug fix, a new feature, a refactor. Each branch is isolated. A developer can experiment, break things, and iterate without disrupting anyone else.

Branch naming conventions matter. Teams that use patterns like feature/add-search or fix/login-timeout can scan branch lists and understand what work is happening without opening a single file.

Examples

A developer starts working on a new feature.

The developer creates a branch called feature/user-search from main. They make 15 commits over three days, push the branch to GitHub, and open a pull request. The main branch is untouched until the PR is approved and merged.

Two developers work on conflicting changes.

Developer A creates a branch to refactor the authentication module. Developer B creates a branch to add a new login method. Both modify the same files. When Developer A merges first, Developer B must resolve merge conflicts before their branch can merge. The branch model contains the conflict to one developer's workflow.

A hotfix needs to ship immediately.

A critical bug is found in production. A developer creates a hotfix branch from main, makes the one-line fix, gets an emergency code review, and merges within an hour. The fix ships to production while all other feature branches continue their work undisturbed.

In practice

Read more on the blog

Frequently asked questions

How long should a branch live?

As short as possible. Long-lived branches diverge from main and create painful merge conflicts. Best practice is to keep branches under a few days. If a feature takes weeks, break it into smaller branches that merge incrementally behind a feature flag.

What is the difference between trunk-based development and feature branches?

In trunk-based development, everyone commits directly to main (or to very short-lived branches). In feature branch workflows, developers create branches for each piece of work. Trunk-based is faster but requires more discipline. Feature branches are safer but slower.

Related terms

Picks and Shovels: Marketing to Developers During the AI Gold Rush

Want the complete playbook?

Picks and Shovels is the definitive guide to developer marketing. Amazon #1 bestseller with practical strategies from 30 years of marketing to developers.