Answer the question
In order to leave comments, you need to log in
How to properly sync git submodules?
The question is rather naive, but all my life I tried to avoid git submodules and then I got a project where they already exist. Please help me to clarify.
There is project X, it uses project Y as a submodule. When I do it, it downloads some very old version of Y.
Questions:git clone --recursive project_X
git clone --recursive project_X
Answer the question
In order to leave comments, you need to log in
It does everything right. This is done so that when you pull changes in the main, nothing breaks due to changes in the module.
For example, when committing, the module had a certain Super method, but the module received an update and now this method does not exist. The main repository was implemented with this Super method in mind, if you just pull the latest version of the module now, then everything will break.
If you need to update the module, then go into it and do a git pull, and then, in the main repository, commit the module update.
git pull in module
Make a commit in the main repository with the new version
No. This is not necessary because the main repository may break.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question