DEV Community

Discussion on: Git Submodules Revisited

Collapse
 
dextermb profile image
Dexter Marks-Barber

On the opening page it briefly shows the branch config option:
git-scm.com/docs/git-submodule#git...

[submodule "<path>"]
    path = <path>
    url = <repo>
    branch = <branch> // <-- magical
Enter fullscreen mode Exit fullscreen mode

We use branches as versions, so each minor change to a submodule increments the branch property. We then run:

git submodule sync
git pull --recurse-submodule
Enter fullscreen mode Exit fullscreen mode

...to make sure that everything is updated. You're right in saying that it doesn't seem too well documented though.