Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal: Pathspec 'autoload_classmap.php' is in submodule 'module/CocktailMakerModule'

Tags:

git

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.

like image 525
ufk Avatar asked May 12 '14 14:05

ufk


2 Answers

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.

like image 137
ufk Avatar answered Oct 18 '22 22:10

ufk


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.

like image 31
kenorb Avatar answered Oct 18 '22 22:10

kenorb