1

I am creating feature branches like this -

feature/featureA
feature/featureB
feature/featureC
feature/featureD
feature/featureE

All these branches are getting created from the development branch and then it gets merged back to development branch.

Here, for example, if all these branches have been merged in order which is listed, is there any way that I can remove a particular feature from development branch after its merge without affecting any further merges which happened?

For example, I want to remove merge of feature C but want to keep merges that happened for branches featureD and featureE.

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74
user2869736
  • 133
  • 9
  • 1
    `git revert` that merge commit – iBug Jun 11 '21 at 05:24
  • 1
    What does "remove merge of feature C" even mean? Merges are not "things". And you can't go backwards in time. It's like you were just saying; branch and merge. If you don't like the state of your dev branch, write a bug fix branch that corrects it, and merge that. – matt Jun 11 '21 at 06:03
  • I know it's not doable but still wanted to see that is there any solutions. – user2869736 Jun 14 '21 at 05:35

1 Answers1

0

is there any way that I can remove a particular feature from development branch after its merge without affecting any further merges which happened?

It depends if the next merges D and E represent features which depend on what C includes.
But assuming D and E can still compile/run without C, then you would simply revert the merge commit, creating a new commit which would cancel what was merged from C.
And then push that new commit.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250