Why is a submodule in detached HEAD state, and is that a problem?
The parent pins an exact commit, so Git checks the submodule out at that commit, not on a branch. It is normal. To edit the submodule, check out a branch inside it first, or commits can get lost.
Explain it simply
The parent said 'edition 3, page 40', not 'whatever is newest', so Git opens the child at that exact commit with no branch attached.
Reading is fine. The trap is editing: commit in a detached submodule, then run git submodule update, and Git moves back to the pinned commit, leaving your work unreferenced. Do git switch main inside the submodule before changes, commit and push there, then record the new pointer in the parent. Set branch in .gitmodules to track a branch with --remote.
Example
cd libs/ui-kit
git switch main # leave detached HEAD
# edit, commit, push
cd ..
git add libs/ui-kit && git commit -m "Update ui-kit pointer"What to say in the interview
"Detached HEAD is expected because the parent pins a commit. Before changing a submodule I switch to a branch there, commit and push, then update the pointer in the parent so nothing is lost."