thisdwhitley / scrawlings

0 stars 0 forks source link

fix submodules #3

Closed thisdwhitley closed 5 years ago

thisdwhitley commented 5 years ago

The netlify build is failing:

10:55:08 AM: Error checking out submodules: From https://github.com/halogenica/beautifulhugo
   4c2db9a..c07daad  master     -> origin/master
error: Server does not allow request for unadvertised object 05c201a0aa1e8e05f3b21f939c20a1e879136621
Fetched in submodule path 'themes/beautifulhugo', but it did not contain 05c201a0aa1e8e05f3b21f939c20a1e879136621. Direct fetching of that commit failed.
10:55:08 AM: Failing build: Failed to prepare repo
10:55:08 AM: failed during stage 'preparing repo': Error checking out submodules: From https://github.com/halogenica/beautifulhugo
   4c2db9a..c07daad  master     -> origin/master
error: Server does not allow request for unadvertised object 05c201a0aa1e8e05f3b21f939c20a1e879136621
Fetched in submodule path 'themes/beautifulhugo', but it did not contain 05c201a0aa1e8e05f3b21f939c20a1e879136621. Direct fetching of that commit failed.
: exit status 1
10:55:08 AM: Finished processing build request in 11.988730538s
thisdwhitley commented 5 years ago

Actually...after I FINALLY got the hand of submodules...I see that Netlify recommends using subtrees instead of submodules damn.

If you have submodules that are in private repositories, or private node modules, or other Git repositories that you need separate access to — well, our build environment only has access to them in case you send the authentication raw materials our way somehow. In general we don’t advise this — for instance: use subtrees instead of submodules and create a copy of the private node modules before sending us a deploy.

https://www.netlify.com/blog/2016/10/18/how-our-build-bots-build-sites/

thisdwhitley commented 5 years ago

Git subtree: the alternative to Git submodule - for your reading pleasure...

thisdwhitley commented 5 years ago

Submodules will not work with Netlify. So I am going to abandon this. Here is how I removed submodules (which is harder than it should have been):

  1. echo "" > .gitmodules
  2. git add .gitmodules
  3. sed -i '/\[submodule/,$d' .git/config # careful here, worked for me since "[submodule" was the last stanza in my config
  4. git rm --cached themes
  5. rm -vfr .git/modules/themes
  6. git commit -m "Removed submodule beautifulhugo"
  7. rm -vfr themes

REFERENCE