Fatal: Pathspec 'autoload_classmap.php' is in the module subodule '/ CocktailMakerModule'

I have a google repository with my project.

I am using git control source.

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 am not trying to add a submodule. I'm just trying to add a directory to git!

The result that I have is that this directory is empty. Therefore, when I try to add certain files, I get the above error message.

I checked and there is no other .git directory in this directory, so I'm really confused why this happened.

+7
git
source share
2 answers

I still don’t know how it happened. All the documentation that I read suggests that I have a .git directory, but I do not.

I just did the following:

 git rm -rf --cached CocktailMakerModule/ git add CocktailMakerModule/ 

This seems like a solution to the problem.

+37
source share

To remove an unwanted submodule, you need to cancel it:

 git submodule deinit CocktailMakerModule 

then add the directory or file again:

 git add CocktailMakerModule 

Check out the current outstanding submodules: git submodule status .

For more information, check out the Git manual by running: man git-submodule .


Otherwise, if you want to save this submodule, follow these steps: Git: fatal: Pathspec is in the submodule .

+1
source share

All Articles