A team uses Azure Repos with a Git branching strategy that includes feature branches. They want to ensure that all feature branches are deleted automatically after the pull request is completed. What should they do?
Trap 1: Enable 'Create a merge commit' option in the branch policy.
This option changes merge strategy, not branch deletion.
Trap 2: Configure branch retention policy in the pipeline to delete…
Retention policies delete old runs, not branches.
Trap 3: Create a work item to remind developers to delete branches after…
This is not automated enforcement.
- A
Enable 'Automatically delete source branch' in the branch policy.
The branch policy setting 'Automatically delete source branch' removes the feature branch once its pull request completes and merges, satisfying the requirement for automatic cleanup without manual deletion or scripts. It applies per branch policy in Azure Repos.
- B
Enable 'Create a merge commit' option in the branch policy.
Why it fails: This option changes merge strategy, not branch deletion.
- C
Configure branch retention policy in the pipeline to delete branches after build.
Why it fails: Retention policies delete old runs, not branches.
- D
Create a work item to remind developers to delete branches after merge.
Why it fails: This is not automated enforcement.