I have a git repository with submodules in the directory projects/myRepo and I want to rename the directory to projects/my-repo.
According to this question it can simply be done with mv. But in a repo with submodules git keeps telling me
fatal: Not a git repository: projects/myRepo/.git/path/to/submodule“`
even for git status.
Submodule config:
[submodule "path/to/submodule"]
path = path/to/submodule
url = https://github.com/user/projectName.git
Somehow the ‘internal path’ for the submodule does not get updated?! Is there a way to tell git to update these submodule paths?
Since Weston‘s test (clone, init and update of a submodule in a cloned repo) worked as expected when renaming the directory including said submodule, I suspect something must have been wrong in the submodule
.gititself in your original Git repo submodule.You could compare/look for any file referencing ‘
myRepo‘ in that first submodule.you can also compare the content of the two submodules (the first one you tried to rename, and the second one included in the repo that you cloned)