0

Is it possible, with git, to automaticaly make a merge inside a submodule only asking merge inside main module ? Is there a command / option to do that ?

Goal is, in main module, to be on branch1 with submodules on same branch1. When a merge command between branch1 and a remote branch is used within main module, that merge branch1 with remote branch within submodule too.

1 Answer 1

2

Shortly, no. You need to specify it for the submodules using git submodule update --remote --merge.

You can see plenty of explanations on submodules in the official documentation here.

Sign up to request clarification or add additional context in comments.

6 Comments

After reading, I understand that --remote --merge permit to merge local modification with remote modification. Is it correct ? If yes, I have update my OP (not sure that this change your answer)
That is right. It will update your local changes to the remote (from super-repo to submodule) by merging the two latest commits, and the head is attached to the branch that the submodule is tracking. See man.
Thanks, yes I read man, my first comment is a question after reading man. Sometime it is not sufficient to understand. Unfortunately I have some errors when trying this command. I'm going to dig.
If you like, you can provide the errors and I will try to help.
Ok, I have manage to solve error : to use git submodule update --remote --merge, specified a tracking branch is needed (by defaut it is master). It can be achieve with git config -f .gitmodules submodule.submodulename.branch branchname. Your command solve my problem, many thanks
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.