Reputation: 609
Whenever I use submodules in git
find myself doing
git submodule init
git submodule update
What's the logic in two commands when you basicly do those commands every time?
Upvotes: 0
Views: 359
Reputation: 1909
They do have a way to do it in one call:
submodule update --init
source : https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-init--ltpathgt82308203
Upvotes: 0
Reputation: 410662
git submodule init
initializes the machinery, whereas git submodule update
pulls in new changes for the submodules. If you're adding a submodule, there's nothing to update yet, so you only need to run git submodule init
to initialize the repo. (It creates a .gitmodules
file, as well as some stuff in .git/
for tracking submodules.)
Upvotes: 1
Reputation: 84
Not sure about the separation, but an easy workaround would be to use an alias.
alias gitrox="git submodule init && git submodule update"
Upvotes: 1