Basically I have a repo where I cloned another repo. And now I want to add that sub-repo as a submodule of the parent repo but when I do git submodule add http://sub-repo path-to-sub-repo
on the parent repo it gives me this error.
fatal: '/path-to-sub-repo' does not have a commit checked out
I suppose that this means that the sub repo has pending commits but no. Neither the parent repo nor the sub repo have pending commits or untracked files.
This is a similar question but the answer is to make a new repo which is not what I want.