threads / discuss / 55412

git submodule problem

Subject: git submodule problem

## tl;dr

One message between Mar 30, 2021 and Mar 30, 2021.

replies: 0people: 1as markdown or json

Erik Claij· Mar 30, 2021, 09:09 UTC · lore
Dear git,
Changing branch with
     git checkout --recurse-submodules <branch>
does not work when the branch does contain a new submodule.

Cloning a repo without submodules in master but submodules in the <branch> will reproduce this problem.

Error
     fatal: not a git repository: 
../../.git/modules/module/esp32_peripherals
     fatal: could not reset submodule index
The alternative way does work
     git checkout <branch>
     git submodule update --init --recurse
     git clean -ffd
Best,
Erik Claij

← back to recent threads