Skip to main content

Removing components from a PR/feature branch in Pipelines (expanded branching model)

How to remove components from an open PR in Pipelines

Written by Kevin Slattery

If you've committed components to a feature branch that you no longer want in your pull request, you can remove them by rolling back part of the commit. This lets you clean up the feature branch and PR without changing anything in your Developer Sandbox.

This article covers the same advice as detailed in Scenario 0 in this document about rolling back changes in a Pipeline, but called out here for clarity.

​

Choosing your approach

There are two ways to remove components from a feature branch:

  • Commit more changes: You can use the Commit more changes workflow to remove components, but only after you've first removed those changes from your Developer Sandbox.

  • Roll back the commit (recommended): If you want to keep your Sandbox as it is, roll back the relevant part of the commit you made to the feature branch. The rest of this article walks through this approach.

Step 1: Find the commit in Deployment History

  1. Go to the Deployment History page in Gearset.

  2. In the search box, enter the name of your feature branch. This filters the list to the commits made to that branch.
    ​

  3. If you don't see the commit you're looking for, adjust the date filter. Commits made a while ago may fall outside the default date range.

Step 2: Roll back the components you want to remove

  1. Once you've located the right commit, click Roll back. Gearset creates a rollback comparison. Read more on this process here.
    ​

  2. In the comparison results, select only the components you want to remove from the feature branch. Anything you leave unselected stays in the branch.

  3. Continue through the deployment as you would for any other comparison and deployment.

If the components you want to remove were added across several commits, repeat these steps for each commit.
​

What happens next

When the rollback deployment completes, Gearset creates a new commit on the feature branch. This commit automatically updates the pull request, removing the components you selected. Your Developer Sandbox is unaffected.
​
If the PR you are removing components from has already been promoted to an environment (or multiple), then you need to re-open a PR from your feature branch to the appropriate environment branch (usually UAT, INT, QA). This can be done in Gearset, or in your version control system. Whichever, you are most comfortable using.


​

Further reading

Did this answer your question?