Introduction
Note: This setting isn't available during the initial Pipeline creation.
On the Pipelines page in Gearset, click the cog icon
-> Edit pipeline details... and then in the "General" tab of your Pipeline settings you can enable Auto delete feature branches toggle.
What does the setting do?
This setting automatically deletes feature branches when there are no open pull requests from the feature branch or any promotion branch (promotion branches are created by Gearset off your feature branch to propagate the pull requests via the Pipeline).
How does auto deleting feature branches help?
Auto deleting your feature branches ensures that the Pipeline repository is no longer showing any older or unwanted branches that otherwise may cause 'noise' in the repo.
The 'noise' would also be visible in Gearset when you preview the list of branches associated with that repository (e.g. on Compare and deploy page), for example when searching for a feature branch to which you'd like to make a commit.
How does the toggle work?
When the toggle is enabled, Gearset deletes 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 toggle also applies to project branches created in the Long Term Project that are auto deleted once the features are merged into the project base branch.
Gearset deletes the feature branch once no open pull request references the feature. Promotion to the final environment is not enough on its own, because back propagation pull requests still reference the feature.
Why is my feature branch still there?
Gearset keeps the feature branch when any of these are true:
An open pull request back propagates the feature, including back propagation for a bundle or release that contains it.
An open pull request resolves a conflict for the feature, or for a bundle that contains it.
Your pipeline has isolated environments in the main pipeline, so Gearset can't determine whether the feature still needs back propagating.
Your pipeline has isolated Long Term Project environments not connected to the main pipeline, so Gearset can't determine whether the feature still needs back propagating.
Developer sandbox updates don't hold a feature branch open as they reference commits, not features.
What to be aware of?
1. Enabling the toggle will delete any feature branch without an open pull request.
2. In the Pipeline, if you are closing the pull request (which also deletes the promotion branch starting with gs-pipeline, such as gs-pipeline/Auto-Delete-Feature-Branch from below example), the original feature branch can also be deleted automatically.
3. 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 remains unticked in the dialog box below!
Then you can safely select Close pull request.
If you wish to make a change to an in flight feature, then following the steps from this article is recommended:



