1

Some dependencies we merged into our main are now proving to have many downstream impacts.

At this point, the MR that updated these dependencies is previous to several newer MRs.

So if I have MR's as such:

336!
337!
338!

I need to revert to 336! merge in 338!.

Proposed Solution I think I will create a bugfix branch that is an initial pull from 336!. Then I will merge 338! into my new bugfix branch. Test it of course, and then Merge this branch into the master.

This will inherently overwrite the changes that were made in 337!? Or will merging in 338! merge in 337! changes as well?

SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34
Hofbr
  • 868
  • 9
  • 31

1 Answers1

1

Another option would be to revert 337 in a bugfix branch created from main.

Initially, that bugfix branch includes all main history, including your 3 MRs.

But, by reverting 337!, you would:

  • add a new commit cancelling 337 changes
  • keep 336 and 338
  • resolve in that branch any merge conflicts and test if everything still work.

So:

git switch -c bugfix main
git revert <3371 merge commit>
# test
git switch main
git merge --no-ff bugfix

Then you merge bugfix to main.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for this. In this sequence above, after reverting to `336!` at one point do I just merge in `338!` and skip over `337!`? – Hofbr Apr 05 '22 at 18:58
  • @Hofbr The bugfix branch already include 337 and 338, so nothing to merge in bugfix. You just have to merge bugfix to main. – VonC Apr 05 '22 at 22:00
  • Got it. My question may have been unclear but in my scenario `337!` is the problematic one. So I'm trying to revert to `336!` and incorporate `338!`. – Hofbr Apr 05 '22 at 22:49
  • @Hofbr then simply git revert 337. Since the branch already include 336 and 338, those are incorporated. – VonC Apr 05 '22 at 22:52