Git merge for repository includes submodules

0

I have a repository, let’s call it PARENT, which includes many submodules (submodules name: A, B, C, …). the PARENT has different branches and each branch has different submodules. I have to merge different branches into master branch after each successful deployment. I use the following commands

$ git clone --recurse-submodules https://.../../PARENT <PARENT repository URL>
$ cd PARENT
$ git merge -X theirs origin/foo <master is default branch and foo is another branch>

Failed to merge submodule A (commits don't follow merge-base) 
Auto-merging A 
CONFLICT (submodule): Merge conflict in A 
Failed to merge submodule B (commits not present) 
Auto-merging B 
CONFLICT (submodule): Merge conflict in B  
Auto-merging .gitmodules 
Automatic merge failed; fix conflicts and then commit the result. 

the .gitmodules file merge without an issue, but the ref. number for submodules doesn’t merge.

How can I solve this?

Hi @teodik thanks for bringing this question up here.

This is a bit out of my normal scope, but I wanted to provide some guidance that may help get you going in the right direction.

You may want to use the verbose -v flag on your merge to see if that presents more information.
Also, could you do a git status on that and copy the results here?
That may give more clues about what is going on here.

Finally, take a look at the Merging Submodule Changes section of the Git Tools Submodules docs.