This occurs when the repository is using files cloned from another repository, but has had no mapping reference to the source repository created for it. The mapping needs to be added to a .gitmodules
file located in the root directory of the repository you are using.
To create the mapping reference, enter the following into your .gitmodules
file:
[submodule "path_to_submodule"]
path = path_to_submodule
url = git://url-of-source/
Where path_to_submodule
is the actual path within your repository (relative to the root directory) where the submodule will be used, and url-of-source
is the URL of the original repository that contains the submodule's files.
In the case that you might wish to remove an unwanted submodule from your repository, run the following command in your local repository, then push the change to the remote:
git rm --cached path_to_submodule
Where path_to_submodule
is the path to your submodule.
Reference: https://www.deployhq.com/support/common-repository-errors/no-url-found-for-submodule