Search notes:

git submodule

Initialize, update or inspect submodules.

After cloning

Get all submodules after freshly cloning a repsitory
git submodule update --init --force --remote

updating submodules

git submodule update (executed in the superproject's directory) updates the submodule(s) to the commit that is specified in the index of the superproject.
A submodule can be updated to its remote's latest commit by going into the submodule and executing and pulling it from there:
cd submod

# HEAD might be detached, or pointing to another branch:
git checkout master

git pull

cd ..
git commit -am "Updated submodule to most recent version"
When dealing with multiple submodules or to make things easier, there is also:
git submodule foreach git pull origin master

foreach

git submodule foreach … executes a shell command in each checked out submodule.
When executed in (typical?) git installation on Windows, it executes the command in bash (which is installed with git).
Git provides a few shell variables that can be used in the foreach command:
$name The name of the relevant submodule section in .gitmodules
$toplevel The absolute path to the top-level of the immediate superproject.
$sm_path The path of the submodule as recorded in the immediate superproject
$displaypath The relative path from the current working directory to the submodules root directory
$sha The commit as recorded in the immediate superproject,
foreach has the two options
git submodule foreach --quiet 'echo $SHELL - $toplevel - $name - $sm_path - $displaypath - $sha1'

Just update the submodules

git pull
git submodule update --recursive

See also

git clone --recurse-submodules …
git commands

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759391085, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/version-control-systems/git/commands/submodule(101): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78