1

What should I use to update the reference to the committed submodule to the parent project so nect time I clone recursively the project It downloads the correct submodule commit?

Should I opt for git submodule --init or should I just git add submodule/path commit and push?

Note: my submodules are specific tags, not branches that have to be followed

DDS
  • 2,340
  • 16
  • 34

1 Answers1

2

git submodule add is needed when you want to create a submodule entry in your repository, that is a gitlink (SHA1 recorded as a special entry in the index)

There is no git submodule --init, only git submodule init, which presupposes the submodule has already been added, and you want to initialize its submodule.$name.url setting in .git/config.

git submodule update will then update the submodule content of the ones declared in .git/config by git submodule init.
You can see an example here.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250