Github subdirectories

Hi everyone

I’m not a very experienced Github user but I’m thinking about setting up my own starter Kirby repository containing a collection of plugins, fields and generic snippets to start of new projects. Now my question for the Github pro’s: is there a way to clone just a subdirectory for e.g. a certain plugin into my current local project or do I always have to clone the whole repository and then sort out everything I don’t need? As far as I know the standard approach is to clone everything, but maybe there are some alternatives?

Thanks for every hint :vulcan_salute:

I also have my own starter boilerplate, with e.g. npm and gulp in it.
In there I have Kirby and the panel as git submodules. When I need plugins later on I usually add them via git submodules too.

But then again, I don’t strip things out of fields and plugins … ?

What exactly do you mean? You want. to have sort of a base repo on GitHub and then only checkout parts of that main repo? Like this:

Thanks texnixe, yes exactly. I think the sparse checkout approach is what I was looking for.

And yes, my initial thought was to setup a base repo which includes a handful of prebuilt snippets like a testimonial section, a gallery and thinks like that and then to be able to clone selectively such a snippet into my current project when needed. That said I came to the conclusion that it makes more sense to simply clone the whole base repo for every new project and then strip out everything I don’t need.

I know the setup with submodules but this means to have every part, for e.g. every prebuilt snippet in a separate repo, which seems to be way too much effort. And no, I don’t want to strip things out of fields and plugins, just to be able to add them separately from a base repo. And yes, I see, to add plugins later the submodules are a good solution.

Thanks for helping out, it’s great to have such support even on weekends!