Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failing to deploy website on Netlify when trying to use alternate hexo theme

Tags:

git

netlify

hexo

·Trying "git clone" lead to the following message when deploying:

failed during stage 'preparing repo': Error checking out submodules:fatal: No url found for submodule path 'themes/ocean' in .gitmodules

·Trying "git submodule add" lead to the following:

failed during stage 'building site': Deploy directory 'public/' does not exist

A temporary solution seems to be removing the .git folder within the theme,but is there any better choice?

like image 749
Dzx Avatar asked Oct 22 '25 09:10

Dzx


1 Answers

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

like image 196
Anantha Raju C Avatar answered Oct 23 '25 23:10

Anantha Raju C



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!