mirror of
https://gerrit.googlesource.com/git-repo
synced 2026-11-13 07:47:23 +00:00
Sparse checkout allows Git to check out only a portion of the repository. This is particularly helpful for monorepository workflows where CI jobs only need a portion of the repository to run tests. This speeds up the CI jobs, and puts less load on the Git server as it relieves it from having to pack up all the objects. In the Git project, though it is still labeled experimental, the feature has been stable for a number of years and is unlikely to change at this point. This change allows configuring Git to use sparse checkout and provide a list of directories for the sync command to retrieve. Projects with sparse paths default to a blob:none partial clone so the excluded paths are never fetched, unless a filter is already configured or the project is excluded from partial clones. Both the plain and the git-worktree checkout flows configure sparse-checkout before populating the working tree. Change-Id: I772c7db5209b345306be378771c8f2040832bca1 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/535061 Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: John Cai <johncai86@gmail.com> Commit-Queue: John Cai <johncai86@gmail.com> Reviewed-by: Mike Frysinger <vapier@google.com>