I\'m trying to add a submodule to my git repo, and I\'m getting this error in return:
remote origin does not have a url defined in .git/config
(I've summarized just the solution here. Credit goes to VonC.)
In the containing repository (say containing.git/
), git
interprets relative paths as relative to the origin
remote, which is not defined. We want it to be relative to the containing.git/
directory, so run
git remote add origin ..
(Not sure why it's ..
rather than .
.)
Now you can add the sub-module:
git submodule add ../extern/Lib1 lib