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.