2

We have a submodule in our super project. That submodule uses a sparse checkout (think of the submodule as a large core library where we choose which parts are necessary for the current project). Despite the checkout working perfectly with its sparse checkout on the original project, new clones of that repo don't have any of the sparse checkout information; the config of the file has no 'sparsecheckout=true' and the info folder has no 'sparse-checkout' file.

What am I missing?

I ran:

[[I assume the foreach approach still works with only one submodule]]

git submodule update --init --recursive
git submodule foreach git read-tree -mu HEAD
git submodule foreach git pull origin master

EDIT 1: Looks like my repo also shows the entirety of the submodule, not the sparse checkout... which leads me to believe that information is never stored??

  • A clone is still a different repository. You told a repository to hold its hands a certain way, that's not going to make all its clones hold their hands that way. – jthill Apr 01 '16 at 00:30
  • @jthill Is there no way to make a submodule always have the same .git settings? That seems like a huge hole in git if not. If I only need a quarter of the modules in a library suite that's a submodule of my project and I'm being forced to have all of the modules when I check out my super project, how does anyone else know what to put in the sparse checkout if I'm not present? – Steven Sauer Apr 01 '16 at 17:17
  • If you want to suggest default repository config values with your project, do that. Put some config commands in your readme, or supply a repo-setup script, or however seems good to you. But just as your repositories are yours, other people's repositories are theirs. They get to control how their repositories are configured. – jthill Apr 01 '16 at 17:23

0 Answers0