DEV Community

Discussion on: Git Submodules Revisited

dwd profile image
Dave Cridland Author

No, I didn't find that section - I found the sections on --branch and --remote, and man 7 gitsubmodules has no mention of branch at all as far as I can see.

If there's something more, I'd love a pointer!

dextermb profile image
Dexter Marks-Barber

On the opening page it briefly shows the branch config option:

[submodule "<path>"]
    path = <path>
    url = <repo>
    branch = <branch> // <-- magical

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 make sure that everything is updated. You're right in saying that it doesn't seem too well documented though.