Skip to content

Cache efficient checkouts of subdirectories of large git repos #6292

Closed

Description

@sipsma

Right now when checking out git repos (whether users of our Git API in core or Dagger's internal use for e.g. loading modules), even if only one subdirectory of a git repo is needed, the full repo still needs a clone (to my knowledge).

We use buildkit's Git source implementation, which does jump through hoops to use sparse checkouts and performance optimizations, but it doesn't yet support features in newer versions of git that enable only pulling the files needed for a certain subdirectory of a git repo (i.e. as described on stackoverflow here).

Being able to take advantage of that optimization could make a big difference when it comes to pulling huge monorepos that's only needed for certain subdirectories.

Activity

  1. locked and limited conversation to collaborators on Mar 24, 2026
  2. converted this issue into a discussion #12375 on Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions