RE: fatal: could not reset submodule index
From: Antoine W. Campagna <hidden>
Date: 2018-06-14 18:19:35
On Wed, Jun 13, 2018 at 18:19, Antoine W. Campagna wrote:
Here is the full reproduction instructions:
Newlines got mangled, making my message hard to read. Sorry. Here is the corrected reproduction instructions: # Create a repository mkdir main cd main git init touch main.txt git add main.txt git commit -a -m "Initial commit" cd .. # Create a second repository mkdir sub cd sub git init touch sub.txt git add sub.txt git commit -a -m "Initial commit of repo sub" cd .. # Add the second repository as submodule, on a separate branch cd main git branch with-submodule git checkout with-submodule git submodule add ../sub sub git commit -a -m "Add submodule" # Set main repo back to master branch (without the submodule) git checkout master cd .. # Make a clone and checkout the branch git clone main clone1 cd clone1 git checkout with-submodule # Submodule is not automatically updated (sub folder is empty) git submodule update --init --recursive