I have a repository on google code with my project.
I use Git source control.
It seems that when I try to add files to git from a specific directory, I get the following error:
fatal: Pathspec 'autoload_classmap.php' is in submodule 'module/CocktailMakerModule'
Now I'm not trying to add a submodule. I'm just trying to add a directory to git!
The result that I have now is that this directory is committed empty. So when I try to add specific files I get the above error message.
I checked and there isn't any other .git
directory in that directory, so I'm really confused to why this has happened.
Still no idea how it happened. All documentation I read assumes I have a .git
directory there but I don't.
I just did the following:
git rm -rf --cached CocktailMakerModule/
git add CocktailMakerModule/
That seems to resolve the issue.
To remove unwanted submodule, you need to unregister it by:
git submodule deinit CocktailMakerModule
then re-add the directory or file again:
git add CocktailMakerModule
Check your current outstanding submodules by: git submodule status
.
For further info, check the Git manual by running: man git-submodule
.
Otherwise if you want to keep this submodule, please follow: Git: fatal: Pathspec is in submodule.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With