0

So I have a blog up and running fine using Jekyll and GitHub. The weird thing is that when I view my repo via the GitHub website and navigate to the folder containing my blog, it is greyed out (the icon is a double grayed out folder one on top of the other).

Also when I clone my repo the folder doesn't copy any files locally. Everything else copies just fine except the folder containing my blog.

Is this because it is being hosted from that folder? I think this is not the case and I did something wrong. The strange thing is I can commit to the folder and the blog works perfectly.

For obvious reasons I want to be able to make posts via browser sometimes and when I clone as a back up I want my blog to be downloaded as well.

Can anyone help?

Maximillian Laumeister
  • 19,884
  • 8
  • 59
  • 78
soulrain
  • 315
  • 2
  • 5
  • 12
  • I figured it out ... my blog folder is in a private repo but my xxx.github.io site which is hosted on my domain is public. I guess the xxx.github.io repo that git uses has to be public to serve files? – soulrain Sep 23 '15 at 20:48
  • Please see the addition that I edited into my answer. It shows how you can clone recursively so that when you clone your outer repo, your blog repo gets downloaded as well (so no more blank folder). – Maximillian Laumeister Sep 23 '15 at 20:54

1 Answers1

1

This looks like a git submodule to me:

✓ Folder is a double grayed out folder icon on GitHub

✓ When repo is cloned, files from the folder are not copied locally

✓ Can commit files in the folder

Looks like you may have accidentally created a git submodule. The way to fix this would be to look for a .gitmodules file in the root of your local repository. Delete the .gitmodules file and it should "free up" all of the files in that folder so you can commit them normally into your repository. Commit, push, and it should be fixed!


In response to your comment (which makes it clear that you are using submodules on purpose), to clone a repository including all submodules, use git clone --recursive instead of the normal git clone. This will cause all the files (and indexes) from your submodules to be downloaded as well, so you no longer get empty folders.

Maximillian Laumeister
  • 19,884
  • 8
  • 59
  • 78