This command works to get the files and compile them:
git clone a-valid-git-url
for example:
git clone git://cfdem.git.sour
I suddenly got an error like in any directory I tried to run any git command from:
fatal: Not a git repository: /Users/me/Desktop/../../.git/modules/some-submodule
For me, turned out I had a hidden file .git on my Desktop with the content:
gitdir: ../../.git/modules/some-module
Removed that file and fixed.