Submodules
Init, update, recursive update, sync and deinit, the status each submodule reports, and why no submodule operation takes a recovery capsule.
The status each submodule reports
Every submodule is listed with its path, its configured URL, the oid the superproject records for it, the oid it is actually at, whether it has been initialised, and whether its own working tree is dirty. That is enough to tell the three situations apart that a single icon usually blurs together: not initialised, initialised but moved off the recorded commit, and initialised with local edits inside.
The three actions
# initialise and update, recursion optionalgit submodule update --init --recursive -- vendor/protocol# re-sync configured URLs from .gitmodulesgit submodule sync --recursive# de-initialise, removing the checkout from diskgit submodule deinit -f -- vendor/protocol
| Operation | Risk | Captured first |
|---|---|---|
| Update / init | caution | Nothing: see below |
| Sync | caution | Nothing: see below |
| Deinit | destructive | Nothing: see below |
Why no submodule operation takes a capsule
A superproject capsule cannot restore a nested checkout
A submodule’s working tree is an independent repository. A capsule of the superproject holds the superproject’s refs, index and patches; it does not hold the nested checkout, and restoring it would not bring one back. Rather than advertise a rollback that would quietly fail, these operations declare no checkpoint and no rollback at all, and the plan prints the reason where you would otherwise look for the recovery step.
The protection that does exist is a precondition instead. Update and deinit both require the selected submodules to have no local changes; the plan names every dirty submodule and blocks until those changes are committed, stashed or discarded inside the submodule itself. That is a real gate, checked against Git, not a warning you can click past.
Add a submodule to the catalogue in its own right and it gets the full treatment: its own status, its own plans, its own capsules. The boundary here is only about what the parent’s capsule can promise.