How to avoid this error - Your site is having problems building: The submodule was not properly initialized with a .gitmodules file?


During the course in parallel I've been trying to deploy my website (stored on my local computer) to GitHub Pages.
I've bee using iTerm on my Mac computer and following all the steps to initiate git, add remote origin repository etc.
I've pushed my website to GitHub repository successfully as well.
As an outcome I get this error:
" Your site is having problems building: The submodule was not properly initialized with a .gitmodules file. "
And I see 404 error when I'm trying to visit my website on FitHub pages.
Note that I've used as a name of my repository.
Also note that I've created my website following the instructions from the first unit using Jekyll.

What am I doing wrong and how could I fix this problem to get my website shown on GitHub Pages?


can i see a screenshot of the commands you executed on your computer? Make sure when you add the git remote origin that you it ends with .git:

git remote add origin

You can show screenshots to confirm you done this correctly?



it seems a git submodule wasn't properly initialized. You could remove .git altogether and try re-initialize all together, or inspect your submodules

I must admit i have never heard of them, but i found a very similar stackoverflow question

I think it is best to just re-initialize altogether


What do you mean by removing .git altogether? And how to do it?


when you initialize a git repository with git init a .git directory is created in the current working directory.

If mac uses the same commands as linux (given they are both unix derivatives, good change) you could do something like: rm -rf .git/

careful with this command, the r and f flag make it rather powerful


Re-initialization doesn't help. I still get the same error. And I really don't understand how these submodules work.


I never heard of these sub modules before either, and i can't fix them from here. I will ask around, maybe this is a question for stackoverflow?


This is a strange case. You provide a course with instructions how to deploy a website, but I can't do it following them.
It seems very impractical to follow these steps in your interface not being able to implement this knowledge outside.
What's the use of it if I spend couple of hours studying your units just to go to google and stackoverflow to find a solution myself?


For it not to work all it requires is a small difference. This could be related to OS (mac vs linux) or git (version), or RoR and gem versions.

If you where to have an exact duplicate of the codecademy environment, you could just copy and paste. Experience has learned me, this is very often not the case.

So yes, codecademy teaches you the basics, but sometimes there are problems you need to solve.

Listen, i would love to help you, but i haven't heard of these sub modules either, i have no experience with mac, and helping on a forum with such a specific problem in a environment i don't even have access to, is super difficult. I asked around of anyone else has an idea, be patient, maybe they have


Is your username really "username"?


no, it is not, as you can see in the screenshot he uploaded:


I was able to deploy your website by cloning your repository and pushing it into mine without editing any files.

Soo.. does this have something to do with your github settings for that repository? I'd read through those and/or re-create the repository.

- In the submodule's directory, run git submodule init, then git submodule update.
- Commit and push your changes to trigger another build on the server.

And here something strange happens:
I can run that command (git submodule init) in mine, but not in yours.



git rm -r
git add .
git commit -m "removed submodule"
git push

from inside your repository. No idea if that fixes it. It shouldn't be there though, and it does affect git submodule in some way that I don't understand.

@stetim94 are you able to tell what's "special" about that empty directory?

I think you cloned your repository into your local repository and then added it .. something like that. Maybe.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.