4

I have three feature branches like F1,F2,F3. All of them raised pull request and merged in Development branch.Now I want to Merge only two feature (F1 & F3) from Development branch to Release branch. Any suggestions

I guess Cherry picking works, But not sure how to work on it.Please suggest any other alternate or explain chery picking if it suits my requirement.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
  • Hi Stella, Did you get a chance to implement the solution that jessehouwing suggested? Were you able to resolve? If the reply helped and solved your issue. Appreciate for marking it as an answer, which will also helps others in the community. – PatrickLu-MSFT Oct 18 '19 at 09:43

1 Answers1

5

This isn't specific to Azure DevOps. It's a pure git problem. You have multiple options at this point.

1. Cherry picking may work.

Depending on how the feature branches were merged, you could cherry-pick only the changes that merged F1 and F3. This may be tricky if F2 has touched the same files as F3.

2. Creating a new branch to merge to release

Creating a branch from 'develop' just before F1&2&3 were merged and merging F1 and F3 in that new branch, then merging that into master.

3. Reverting F2 in develop

Compensate the changes introduced by F2 by reverting them on 'develop' and then merging that into master.

4. Interactive rebase of develop.

You could change the history of the develop branch through an interactive rebase. In the rebase operation, drop the changes introduced by F2. Then either force push to 'develop' or push a new branch prior to merging with master.


In the end it may not be a git problem after all. But a planning problem. Why was F2 merged in the first place? What happened that caused it to be discarded further in the process? Why was F3 merged prior to accepting F2?

jessehouwing
  • 106,458
  • 22
  • 256
  • 341