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?
1. Enabling the toggle will delete any feature branch without an open pull request.
2. In a pipeline, if you are closing the promotion branch, the original feature branch can also be deleted automatically.
Closing a PR within your Pipeline
Sometimes teams may want to close an existing PR (e.g. because there is an issue that requires re-work) with intention to add more changes to the branch, and then re-open a PR from the same feature branch.
โ
In such scenario, if you plan to add more work to the feature branch, make sure the option "Also delete the feature branch (branch name) and the promotion branch
" is unchecked in the dialog box below when closing an existing PR within your Pipeline.
Adding changes to an in-flight feature
If you wish to make a change to an in flight feature, then following the steps from this article is recommended: