Gitflow
🪛Submodule Points to Wrong CommitMedium+550 XP
Scenario reference

Submodule Points to Wrong Commit: the situation, step by step

The situation

Your submodule `vendor/shared-ui` is 8 commits behind upstream. CI is failing because a fix you need lives in newer commits.

The parent repo stores only a pointer. Fetching the newer sub-repo commits happens inside the submodule (a nested clone this browser engine has not got); what you stage and commit here is the pointer.

Medium · 3 steps · +550 XP

What you will practice

This scenario walks through 3 steps, in order:

  1. 01See what the parent repo tracks for the submodule
  2. 02Stage the pointer bump
  3. 03Commit the new pointer
Reveal the step-by-step commands

Try the terminal first — you learn more by doing. When you want to check yourself, here is the command for each step.

  1. 1. See what the parent repo tracks for the submodule
    git ls-files
  2. 2. Stage the pointer bump
    git add vendor/shared-ui
  3. 3. Commit the new pointer
    git commit -m "chore: bump shared-ui"

Key takeaway

Submodule updates are two-step: `git submodule update --remote` moves the sub-repo, then the parent repo commits the new SHA. Only the second half is visible from here — and it is the half people forget.