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?