You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
git clone --filter=blob:none <url> - blobless clone. Trees and commits are downloaded, but blobs are downloaded on-demand after checkout. Recommended for developers
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
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.
The text was updated successfully, but these errors were encountered:
That post is very nice indeed! So why not just link to the post instead of writing something up ourselves?
That saves us the work of writing something up without straight up plagiarizing their work. 😄
Also I'm not sure if providing too much help on partial clones is actually helpful for most normal users?
Relevant quote from the GitHub blog (bold emphasis mine!):
Git’s partial clone and shallow clone features are options that can help here, but they come with their own tradeoffs. Each option breaks at least one expectation from the normal distributed nature of Git, and you might not be willing to make those tradeoffs.
So if we're going to write something about partial clones, we should cover that in warnings: "For advanced users only, for normal use just do a normal git clone." and so on.
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:
git clone --filter=blob:none <url>
- blobless clone. Trees and commits are downloaded, but blobs are downloaded on-demand after checkout. Recommended for developersgit 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 historygit 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.The text was updated successfully, but these errors were encountered: