| Category | git |
| Added on | 2026-03-18 |
| Source | source |
De-initialise all submodules then checkout them again (contextual to update)
$ git submodule deinit -f .
$ git submodule update --init
If your sub-modules have their own sub-modules, instead of second command, try:
$ git submodule update –init –recursive –checkout
Last if you have edits in submodules you may get `error: Your local changes to the following files would be overwritten by checkout`.
You can either update specific other submodules with
$ git submodule deinit -f –
or need to investigate and revert the changes.