`git submodule update --remote` fails with `fatal: Unable to find current origin/master revision in submodule path 'libs/common'`.
AdvancedTroubleshootingSubmodules, LFS and Hooks
Answer
Likely causes → --remote tracks the branch in .gitmodules (submodule.<name>.branch), and without one older behavior assumes master. The submodule repo renamed its default branch to main, so origin/master no longer exists.
Diagnose →
git config -f .gitmodules --get-regexp 'submodule\..*\.branch'
git -C libs/common ls-remote --symref origin HEAD
Fix → Point it at the right branch (or . to follow the parent's branch name):
git submodule set-branch --branch main libs/common
git submodule sync --recursive
git submodule update --remote libs/common
git add .gitmodules libs/common && git commit -m "Track main in common"
Prevent → Always set branch = main explicitly in .gitmodules for submodules that use --remote.
More on Submodules, LFS and Hooks
`fatal: No url found for submodule path 'libs/common' in .gitmodules`IntermediateAfter cloning, the submodule directories exist but are empty.Beginner`git submodule update` fails: `fatal: remote error: upload-pack: not our ref 3f2a9c1...` and `Fetched in submodule path 'libs/common', but it did not contain 3f2a9c1. Direct fetching of that commit failed.`Intermediate`git status` keeps showing `modified: libs/common (new commits)` even though you never touched it.BeginnerYou committed inside a submodule, ran `git submodule update`, and your commits vanished.Intermediate`git submodule add` fails with `fatal: 'libs/common' already exists in the index`.Intermediate