I am fairly new to Git and trying my best to find some documentation on this problem to no avail.
Here’s my command:
$ git submodule add https://github.com/joliver/EventStore.git externalsource/JOliverEventStore/
fatal: Not a git repository: ../.git/modules/externalsource/JOliverEventStore
Unable to checkout submodule ‘externalsource/JOliverEventStore’
I am in my root of my repo and there is currently no directory for /externalsource/JO. The error is talking about a directory that I have no knowledge of.
liverEventStore/
If I add the submodule to the root dir like this:
$ git submodule add https://github.com/joliver/EventStore.git JOliverEventStore
I have no problem and it creates the folder in the root directory.
Any insight would be greatly appreciated.
It can depends on the version of Git you are using: this recent thread (February 2012) mentions a bug:
But more generally, uses the
<path>argument ofgit submodule:eoinoc mentions in the comments another cause, which is detailed in the question “
git statusreturnsfatal: Not a git repository but .git exists and HEAD has proper permissions“.