4 ms·
I believe git provides that functionality through sparse-checkout. You can clone a repository without checking it out, then use sparse-checkout to only pull the
by lbhdc 5y ago
I believe git provides that functionality through sparse-checkout. You can clone a repository without checking it out, then use sparse-checkout to only pull the paths you want.
- rcxdude 5y agosparse-checkout only reduces the number of files copied from the local repo to the working directory. It doesn't affect the amount downloaded data. For that you need shallow and partial clones (shallow clones give you a subset of history, partial clones give you a subset of the files within that history). Partial clones especially are a relatively new and not heavily used git feature.
- varajelle 5y agoPartial clone with the --filter feature seems complicated to use. You need to use a bunch of command to set it up and then it looks like you still need to be careful while using it. I'd dream of somethong as simple as git clone --partial foo/bar https://example.com/some.repo.git And then everything would work normally.
- chrschilling 5y agoYour dream came true ;) This is what Josh does: git clone https://example.com/some.repo.git:/foo/bar.git And then everything works normally.