Skip to main content

Pull the latest changes to all your git submodules

git submodule foreach --recursive git pull origin main

Learned that here: Update Git submodule to latest commit on origin - Stack Overflow

There’s lots of discussion there ☝ indicating one or more other options may be preferable now, but this one still works.

git submodule update --recursive --remote

Recommended here and here. Including --remote gets the latest content the submodule repo has, which is what I was looking for.

Related to git-submodules-private-content, which was all originally inspired by Tania Rascia’s linked blog post on the topic, which gave me the idea of moving my content into a private repo my website (a public repo) could pull in as a submodule.