Partial cloning


Considering a big projet with let’s say dozen of libraries, I would like to depose them in a github repositorycalled libraries , were each library would be in a subdirectory of libraries.

I think (I may be wrong) that clone function is only present in first level libraries. It means that if I want to work on a library, I have to get all the libraries… Am i wrong?


Pfeuh (from France)

1 Like

You are correct that git clone is designed to create a full copy of the entire repository. However, it is possible to download only part of a repository to your local machine. There are also ways to create a repository that consists of sub-repositories.

What is it you’re trying to accomplish? If you never want to clone the entire “libraries” repository, then why would you want it to be a repository at all?


Thanks for your answer. As I 'm not native speaker and as I’ve worked 15 years with Tortoise, I’m not able to understand all the gears of Github. I remember that with Tortoise  I could synchronize a part of a project (the full directory of the subproject I was working on, not all the project) and commit or update with the server. I’m going to continue to user gitthub in a regular way, and perhaps later with more knowledge ans experience I will be able to do that.

There are few articles that can help:

You will have to use combination of sparse-check and clone --filter to achieve what you want

Please also refer my answer at :