I'm trying to add a submodule that already existed (different git remote repository). As I didn't searched before how to do it correctly, I think I've messed up my repository and I need some help to fix it again.
I've already deleted all the relevant sections from the .gitmodules and .git/config regarding the submodules I want to delete. I've also verified that there is not modules directory inside my .git/ directory.
However, when I run the command git rm --cached path_to_submodule
, the following message is displayed:
fatal: pathspec 'path_to_submodule' did not match any files
As the previous command fails, when I try to add again the same submodule with the new definitions, running the command git submodule add gituser@host:repo.git
, this is the displayed message:
'repo' already exists in the index