0

I'm facing a strange issue that never happened before and I'm not sure what is the cause.

At the moment we have two develop branches. Let's call them foo (v 3.x) and bar (v 4.x). The logic behind is that in the bar branch we develop new functionality that is not deserved in foo. But at the same time we want to have all the changes done in foo merged to bar after some time.

Our usual way of doing that was by creating new branch: foo-to-bar which branches from foo has all changes pulled to it from bar and when the possible conflicts are resolved we open a PR to bar.

It doesn't work at the moment, this is what happening:

// `bar` contains following changes
   - A
   - B
   - C
   - D

// I create new branch from `foo` and checkout
   - foo-to-bar

// I pull the changes from `bar` to this new branch
   - git pull origin bar

// I get the some conflicts and this is how it looks
   - A > deleted by us [`foo`] and modified by them [`bar`], can be solved
   - B > deleted by us [`foo`] and modified by them [`bar`], can be solved
   - C > deleted/not pulled? without notifying
   - D > deleted/not pulled? without notifying
   - and multiple deletions of `bar` changes within non conflicted files
   

If I branch foo-to-bar from bar and pull changes to it from foo I'll get the same result but have more staged changes visible.

Any idea what is causing this and how to fix it? Would rebase help in this case?

EDIT:

Thanks to the tip from @j6t we were able to locate cause of the issue. So what happened is that at some point bar was merged to feature branch of foo but since that's not correct this merge was reverted.AN this revert contains deletions of multiple files (A,B,C,D etc.).

Any idea how to deal with this? How to presuade foo that those changes should not be deleted?

mat.hudak
  • 2,803
  • 2
  • 24
  • 39
  • You should make an ASCII drawing of the history starting at the last common commit of `foo` and `bar`. Mark the commits where changes to A, B, C, D happen, and also where some of them were deleted. If you want to make the histories visible in a UI, use `gitk foo-to-bar...origin/bar` (not the three dots). – j6t Feb 11 '21 at 07:40
  • thanks for a tip, I'll give it a try – mat.hudak Feb 11 '21 at 07:55
  • 1
    I'm not quite willing to close-as-duplicate immediately, but see [this related question](https://stackoverflow.com/q/21143660/1256452). – torek Feb 11 '21 at 15:08
  • I was thinking of asking to close it anyway as I have found the cause of issue and the solution kind of requires another question. Thanks for the link – mat.hudak Feb 11 '21 at 15:14

0 Answers0