S
S
SomeoneUnknown2019-09-21 11:32:29
git
SomeoneUnknown, 2019-09-21 11:32:29

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

  1. What needs to be done to download the current active master of project Y?
  2. How to fix Y after the update in the previous step? Those. there is even a master Y will go ahead, a strictly defined version was takengit clone --recursive project_X
  3. Is it possible to make sure that master Y is always taken?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Silin, 2019-09-21
@byme

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 question

Ask a Question

731 491 924 answers to any question