Introduction
When setting up a pipeline or when going into pipeline settings you will see a toggle called Auto delete feature branches
:
This setting automatically deletes feature branches when there are no open pull requests from the feature branch or any promotional branch.
This ensures that the repo no longer has older or unwanted branches that are causing 'noise' in the repo.
How does the toggle work?
When the toggle is enabled, we delete any feature branches that do not have any pull requests (PRs) from either the feature branch (or any promotion branches created using the feature branch).
This gives the behaviour that once a feature has been promoted to the final environment in the pipeline, the feature branch gets deleted as all the needed commits and changes will have been promoted into the long standing final branch.
What to be aware of?
Since enabling the toggle deletes any feature branch that has no PRs coming from it, closing a promotion branch in a pipeline will automatically delete the original feature branch as well.
If you wish to make a change to an in flight feature, then following the steps from this article is recommended: