A feature branch is a copy of the main codebase where an individual or team of software developers can work on a new feature until it is complete.
With many engineers working in the same code-base, it's important to have a strategy for how individuals work together. To avoid overriding each other's changes, engineers create their own copy of the codebase, called branches. Following an analogy of a tree, the master branch is sometimes called the trunk. The process of incorporating the changes of an individual's copy into the main master trunk is called merging.
In feature branch development, individual engineers or teams of engineers do not merge their branch until a feature is complete, sometimes working for weeks or months at a time on a separate copy. This long stretch of time can make the process of merging difficult because the trunk or master has likely changed due to other engineers merging their branches. This is known as a merge conflict.
Feature branch development and merging source code is handled in version control software such as Git and Github. The main branch and feature branches live in this code repository (or repo) and developers checkout code to create a new branch to work from.
Once the changes are made to the code, the developer makes what is known as a pull request, or a request to have other developers on the team do a code review to ensure that the local branch does not have any errors, and also that it will not cause any errors when merged into the main branch. Once a branch has been thoroughly reviewed, it can then be merged into the main branch.
Feature branch development is one method of managing many engineers working off of the same codebase. Modern teams often rely on continuous integration and trunk-based development to avoid issues with bug fixes and merge conflicts that arise from the branching model of code development.
One alternative to the feature branch workflow is continuous integration, which is a software development methodology which involves continuously integrated new code changes into the mainline or trunk rather than waiting until a new feature branch has been under development for weeks or months and has diverged from the main branch.
Continuous integration, also known as trunk-based development helps to minimize merge conflicts by continually merging changes into a single source to prevent feature branching. Continuous integration, along with practices such as feature flagging can help developers to deploy code faster with less time spent trying to reconcile different versions of code.
Be inspired by 40+ experiment ideas that have generated millions in revenue.
Learn the benefits of experimenting at scale from this original research report from the Harvard Business Review
This assessment is the starting point to understanding your organization’s capabilities and will set you on the path to building a high-performing program.
An error has occurred
You can get the very best of Optimizely without spending a dime.Try it out for 30 days, on us.
Hang tight! We're creating your account and password instructions are headed to your inbox.
Please correct form errors
Get a free account with full access to Optimizely's APIs and SDKs.
Already have an Optimizely account? Sign in here.