What is the point of 'git submodule init'?
To populate a repository’s submodules, one typically invokes:
git submodule init git submodule update
In this usage,
git submodule init seems to do only one thing: populate
.git/config with information that is already in
What is the point of that?
git submodule update simply use the information from
.gitmodules? This would avoid both:
- an unnecessary command (
git submodule init); and
- an unnecessary duplication of data (
- there are use-cases for
git submodule initthat I do not know (in which case, please enlighten me!); or else
git submodule initis cruft that could be deprecated in Git without any harm.
Which of these is true?
One Solution collect form web for “What is the point of 'git submodule init'?”
git submodule documentation, there is a use-case that ostensibly justifies the existence of
git init as a standalone command.
If a user who has cloned a repository wishes to use a different URL for a submodule than is specified by the upstream repository, then that user can:
git submodule init vim .git/config # Alter submodule URL as desired, without changing .gitmodules # or polluting history. git submodule update