AZ-401: Branch Strategies and Git Worktree Boundaries
Choose a branch strategy by deciding where changes integrate, which released versions need maintenance, and how fixes reach every required line of development. For a team delivering one current service, begin by evaluating a simple mainline and review workflow. Add release branches when stabilization or supported versions justify them; consider the original Git flow model only when its additional branch roles serve an explicit release need. These are contextual design recommendations, not a ranking that guarantees delivery performance.
Choose linked Git worktrees separately, when developers need simultaneous local checkouts. A worktree provides another working directory with its own HEAD and index while sharing repository data. It neither selects the team's branching model nor creates an independent security boundary. The useful design therefore has three parts: an integration and release model, actual merge controls, and a local checkout arrangement.
Compare branch strategies by their purpose
The alternatives overlap. Feature and release branches are building blocks that can appear within a larger method; they are not mutually exclusive products. Compare the role of each branch and the path of a change, rather than counting branch names.
| Approach | Organizing idea | Decision to make |
|---|---|---|
| Trunk-based development | Integrate into one trunk while avoiding other long-lived development lines; short review branches can coexist. | Can the team keep changes small and integrate them promptly? |
| Feature branches | Develop a bounded change away from main, then bring it through review. | What keeps a change reviewable and prevents it from becoming a prolonged parallel project? |
| Release branches | Stabilize or maintain a selected release separately. | Which release needs its own continuing fixes, and who propagates them? |
| Original Git flow | Separate production and integration lines, with prescribed supporting branches. | Does that explicit release structure justify the coordination it introduces? |
| GitHub flow | Move a branch through changes, pull-request feedback, merge and cleanup. | Which configured checks must be satisfied before merge? |
Trunk-based development keeps integration central
The primary maintainer account describes one trunk and resistance to other long-lived development branches. It explicitly allows short-lived branches for review and build checking. Depending on release cadence, a team may cut release branches when needed or release from trunk. Trunk-based development therefore does not mean that every contributor must push directly to a protected branch.
The account also discusses build discipline and techniques for incomplete work, such as feature flags and branch by abstraction. Treat its quality and throughput claims as practitioner advocacy with conditions. No branch layout by itself guarantees a healthy build or faster delivery. As a design recommendation, examine review turnaround and the size of an integration before adopting a method primarily for its name.
Feature and release branches solve different problems
Microsoft's Azure Repos guidance starts feature or topic branches from main, integrates them through pull requests, and emphasizes a healthy main branch. Its release guidance branches from main near a release milestone and makes the supported release an explicit maintenance responsibility.
That guidance describes selective propagation of fixes: a release-line fix can be cherry-picked into a feature branch from main and returned through another pull request. It also acknowledges making the change in main first and porting it to the release. Do not turn this particular release approach into the merge rules of every branching model.
For a team's design, record both the destination of new features and the destination of fixes. A release branch should have a clear support purpose and owner; otherwise, its continued existence leaves an unanswered question about which line represents supported behavior.
Git flow needs its historical and release context
Vincent Driessen's original Git flow model dates to January 2010. It uses master for production-ready code and develop for integration; these are historical names describing roles. Features start from and return to integration. Release branches start from integration and finish in both production and integration.
Hotfixes start from production and return to production and integration. The active-release exception matters: when a release branch exists, the hotfix goes there instead of directly to develop, reaching integration when that release finishes. It may also reach develop immediately if development cannot wait.
The author's March 2020 reflection recommends a simpler workflow for continuous delivery and identifies explicit versioning or multiple supported versions as contexts where Git flow may fit. Read that qualification alongside the original model. It is neither a universal standard nor a requirement to rename a modern branch. Evaluate the additional propagation obligations before choosing it.
GitHub flow describes collaboration, with configured enforcement
The current official GitHub flow guide describes creating a branch, making changes, opening a pull request, responding to review, merging and deleting the completed branch. A contributor needs a GitHub account and a repository. The sequence provides a lightweight collaboration model without prescribing the original Git flow production/integration pair.
Checks run when configured, and branch protection may block a merge that fails requirements. The workflow name does not enable those settings automatically. The current guide also does not mandate production deployment before or after merge. Define deployment ordering for the actual delivery system rather than importing a universal ordering from an older description of GitHub flow.
Choose a model with a concrete release decision
Use the following questions as a proposed team decision process. The answers should identify responsibilities that someone can inspect, rather than produce a label alone.
- What must integrate together? Identify the line where a change becomes part of the team's shared development. Describe the evidence reviewers need before accepting it.
- What must remain separately maintainable? Identify actual supported releases and the period during which each needs fixes. Distinguish an intended future release from a version already in use.
- Where must one fix travel? Trace a representative defect through its required destinations. Assign responsibility for confirming that each destination received the intended change.
- What ends a branch's purpose? Define what completion, release or end of support means for that branch. A branch without a remaining purpose should trigger a cleanup decision, not silently acquire new responsibilities.
- What would make this choice unsuitable? Record the assumptions about review capacity, release cadence and support obligations. Revisit the choice when those assumptions change.
Consider two illustrative decisions, not reports of executed projects. A service team maintaining only its current deployment can evaluate a mainline with short review branches and the current GitHub flow sequence. Introducing a separate permanent integration branch should require a reason beyond the expectation that more branches provide more control.
A team shipping software that customers keep on several supported releases has a different question: who carries a correction to each relevant line? Compare a mainline plus explicit release branches with the historical Git flow roles. Prefer the arrangement for which the team can explain the whole fix path and maintain it reliably. Multiple versions justify examining release structure; they do not automatically require Git flow.
Git worktree boundaries concern local checkout state
A linked worktree is attached to the same Git repository. Its own HEAD identifies the checkout, and its own index holds its staging state. Ordinary branch references and repository data are shared; repository configuration is also shared by default. This is why a second checkout is useful for keeping two local tasks available without making it a separately governed repository.
For example, a developer might keep current development in one directory and inspect a supported release in another. Those directories can serve the team's existing branch strategy. Creating the second directory does not create a new release process or a protected merge path.
The Git manual normally refuses to check out a branch already checked out in another worktree; forcing past that guard deserves explicit justification. Check the installed Git version before adopting command examples from a current manual. No worktree commands were executed for this explanation.
As an engineering implication of the shared repository, treat worktrees as checkout organization. Do not give untrusted automation access to repository data on the assumption that another working directory provides security isolation.
Keep merge governance explicit on either platform
Azure Repos branch policies and GitHub branch protection are separate platform mechanisms. Azure Repos policies can require reviews, builds and status checks; policy editing needs the applicable administrative or repository policy permission. The source strategy should identify the branches that need those controls, while their configuration and enforcement verification remain a separate task.
For GitHub.com, protected-branch availability depends on the plan and repository visibility. Administrator and permitted-role bypass behavior must also be considered. A branch called main, release or develop carries no automatic protection merely because its name matches a familiar model.
Ask the repository owner to verify the real merge paths after the strategy is selected. A documented review convention and an enforced requirement answer different questions. Changing from Git flow to a lighter model, or adding a local worktree, does not establish that required approvals and checks have followed the change.
Review the design before adopting its label
A useful review can follow one proposed feature and one release fix on paper. For each, identify its starting line, review destination, required validation, release destination and any later propagation. Include the active-release case when evaluating original Git flow. If the explanation depends on an unnamed person remembering a second merge, make that responsibility explicit before adopting the design.
Then review the local arrangement independently: which task belongs in each checkout, who controls the shared repository, and which changes require the repository owner's approval? This exposes a common mistake: using a convenient directory layout as evidence that governance has been solved.
The result should be a short, testable team agreement about integration, supported releases and fix ownership. Use Pull Request Enforcement for Human and Copilot Changes for the separate control configuration, and Recovering Selected Git Data Safely when an actual recovery decision is needed.
Authoritative Sources
- Adopt a Git branching strategy — Microsoft's feature/main and distinct release guidance.
- Trunk-Based Development introduction — Maintainer method account; retain its claims and caveats.
- A successful Git branching model — Original 2010 model and essential 2020 reflection.
- GitHub flow — Current official collaboration sequence.
- Git worktree manual — Linked checkout state and shared repository behavior.
- Set and manage branch policies — Azure Repos enforcement context.
- About protected branches — GitHub availability, requirements and bypass conditions.

