Skip to content

Proposal: Partial clone #1597

Open
@bagasme

Description

@bagasme

I proposed to add discussion about partial clone (blobless, treeless, and shallow clones) to the book.

For the text, it can be inspired from this GitHub blog post.

In summary:

When you want to clone a repository, but you don't want full clone (for example because you're on metered internet connection), Git provides three ways to get partial clone:

  1. git clone --filter=blob:none <url> - blobless clone. Trees and commits are downloaded, but blobs are downloaded on-demand after checkout. Recommended for developers
  2. git clone --filter=tree:0 <url> - treeless clone. Only commits are downloaded. Blobs and trees are downloaded on-demand. Recommended for CI builds that needs access to commit history
  3. git clone --depth=1 <url> - shallow clone. Download commit history until specified depth level (roughly corresponds to number of commits), in this case 1 commit. Recommended for CI builds.

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