Cloud concept · Updated

Feature Branching - Feature branching is a source control strategy that develops a change on a separate branch before integrating it into a shared branch.

In short

A feature branch lets an engineer or team commit, test, and review a change without putting unfinished work on the shared integration branch. It creates a clear unit of review and traceability, but the longer the branch diverges from its target, the harder it becomes to integrate.

Cloud Concepts Hub →

5 key aspects of Feature Branching

Feature branching works best when changes are small and short-lived, reviews are linked to work items, and integration checks are separate from deployment controls.

01
One reviewable change per branch

Start from the branch that will receive the change. Keep unrelated fixes out of the same branch so reviewers can evaluate the change and, if needed, revert it independently.

02
Short branch lifetime

Integrate small increments frequently instead of waiting for an entire feature to be complete. Use compatible changes or feature flags when work needs to merge before it is ready to expose.

03
Review and traceability

Link the pull request to the work item and capture the rationale and validation results there. Delete the source branch after merge without losing the pull request record.

04
Validation against the target

Require reviews and passing checks on the integration branch. Where concurrent merges are common, test the combined result with the current target instead of trusting a check run against an older base.

05
Separate deployment controls

Use isolated, disposable environments for branch previews when useful. Keep production deployment permissions and approvals separate from the ability to push to a feature branch.

What is Feature Branching

3 min read

Feature branching starts by creating a branch from the current tip of the intended integration branch, usually main. Despite the name, a feature branch can hold a bug fix, refactoring, or infrastructure change as well as a new feature. Keep each branch focused on one reviewable change. Push it to the shared repository, open a pull request or merge request, and link the work item so reviewers can see why the change is needed and how to verify it. After approval and required checks, merge the change and delete the source branch. The merged code and pull request record remain available after branch deletion.

Protect the target branch with required reviews and automated checks instead of relying on contributors to remember the process. A passing build on a feature branch does not prove that its changes work with the latest target branch. When several changes are landing together, validate the prospective merge result or use a merge queue that tests changes in the order they will land. If the target moves, merge it into the feature branch or rebase according to team policy. Avoid rewriting history on a branch that others are using unless the contributors coordinate it.

In cloud delivery, a pull request can trigger tests and create a temporary preview environment. For example, a branch that adds a billing export can deploy to an isolated preview using synthetic records so reviewers can check the output. Use scoped credentials and tear the environment down when the request closes. For an infrastructure change, generate a plan in the pull request for review, then have the deployment pipeline apply the approved change from the merged revision under separate deployment controls. A branch isolates source changes; it does not automatically isolate cloud resources or grant a safe place to run untrusted code.

Short-lived branches make review practical without postponing integration for weeks. Long-lived branches can accumulate merge conflicts and subtler incompatibilities, such as two changes that pass their own tests but assume different versions of a shared interface. For a large feature, merge small, compatible increments and use a feature flag when incomplete behavior must stay hidden. Branching controls when code is integrated; a flag controls whether integrated behavior is enabled. Neither the merge nor the branch name determines when code goes to production; that depends on the delivery pipeline and release policy.

GitHub Flow is a lightweight example: branch from the default branch, discuss and validate the change in a pull request, merge it back, and delete the branch. Trunk-based development can also use feature branches, provided they are small and merged frequently; the distinction is how often changes integrate, not simply whether branches exist. A release branch serves a different purpose: it stabilizes or maintains a version while other work continues. In classic Git Flow, feature branches typically merge into develop, with separate release and hotfix branches adding coordination overhead. Git worktrees are not a branching strategy: they let an engineer check out different branches in separate local directories, for example to review a fix without interrupting work on a feature.

Feature Branching exam questions

Real practice exam questions on Feature Branching, with the correct answer and its explanation. Answer them with every option in the exam simulator.

DVA-C03

A team stores a document-processing application in AWS CodeCommit. The team measured baseline performance on the revision tagged perf-baseline. The integration branch has since advanced. Two developers will test competing caching implementations and need to push their commits to CodeCommit so a test pipeline can build each implementation independently. Both implementations must start from the exact revision used for the baseline measurement, and neither developer's changes can be included in the other developer's builds. Which solution meets these requirements?

Show answerCORRECT ANSWER

Create two branches in CodeCommit, using `perf-baseline` as the starting point for both. Have each developer push to a different branch and build each branch separately.

CodeCommit can create a branch from a Git tag. Both branches initially reference the exact commit identified by `perf-baseline`. Commits pushed to one branch advance that branch without advancing the other.

Practice Feature Branching in a full exam

Questions on Feature Branching in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

Learn Feature Branching in lessons

1 short lesson on Feature Branching in 1 certification course.

Open the lessons