Private folder (submodule) in a public repo

No: Including a submodule in a public repository means recording its URL in a public .gitmodules file.

The repository at that URL will not be any more accessible through a recursive clone of your repository than it is on its own.

That is why, for instance, using submodules with GitHub Pages is not possible:

You can only use submodules with GitHub Pages sites that point to public repositories.
Using a submodule that points to a private repository is not possible because the Pages server cannot access private repositories.

Leave a Comment