I have a YAML file that might be changed on two different branches within a git repository. For simplicity let's start with this content as a base and create two branches:
a: 1
If I add key b
with value 1
on one branch and key c
with value 2
on the second branch and try to merge both, I get a merge conflict which might be resolved with adding a parameter to merging strategy -X theirs
or -X ours
. In both cases, unfortunately, the resulting merge commit ends up ignoring changes from one branch.
If I understood it correctly, this is intended behavior because git does not analyze the content of the file and works only with diffs on each branch. However, I would like to end up with this:
a: 1
b: 1
c: 1
Is there any simple way to do that?