Reputation: 1664
I have a main repository with several git submodule
s.
Lately I came about a new error which I cannot resolve:
fatal: Could not switch to '~/git': No such file or directory
Clone of '~/git/MyModule_A.git' into submodule path '.modman/MyModule_A' failed
First, I clone the main repo as usual: git clone /path/to/the/bare/repo.git src
Then, I run git submodule update --init
which does correctly register all submodules and they are added to the .git/config
.
Submodule '.modman/MyModule_A' (~/git/MyModule_A.git) registered for path '.modman/MyModule_A'
Submodule '.modman/MyModule_B' (~/git/MyModule_B.git) registered for path '.modman/MyModule_B'
Submodule '.modman/MyModule_C' (~/git/MyModule_C.git) registered for path '.modman/MyModule_C'
fatal: Could not switch to '~/git': No such file or directory
Clone of '~/git/MyModule_A.git' into submodule path '.modman/MyModule_A' failed
MyModule_A
submodule from the .gitmodules
but then the error continues in MyModule_B
, MyModule_B
and so on.~/git/MyModule_A.git
into another folder outside the repo which is working fine..gitmodules
for wrong paths, urls or any syntax problems which is not the case. Upvotes: 4
Views: 2504
Reputation: 1979
The problem is the ~
in your submodule. Git does not know that this stands for /home/<yourusername>
If you replace it (in .gitmodules
) by the absolute path, everything will work.
Upvotes: 5