Overview
Partial clone provides:- Blobless clones - Skip large file contents until needed
- Treeless clones - Skip tree objects for faster clone
- Sparse checkout - Only checkout specific directories
- On-demand fetching - Objects fetched when accessed
Quick Start
Clone Filters
Blobless Clone
Skip all blobs (file contents) during clone:- Checkout a file
- Run
wit diff - Read file contents
Blob Size Limit
Only skip blobs larger than a threshold:Treeless Clone
Skip trees and blobs (fastest clone):Sparse Checkout
Sparse checkout limits which files are checked out to your working directory.Enable Sparse Checkout
Cone Mode
Cone mode (default) only allows directory-based patterns for better performance:Patterns
Disable Sparse Checkout
Configuration
Enable Partial Clone Mode
Sparse Checkout Configuration
Patterns are stored in.wit/info/sparse-checkout:
Object Availability
Check where objects are stored:Fetching Objects
Automatic Fetching
Objects are fetched automatically when accessed:Manual Fetching
Workflow Examples
Large Monorepo
Large Binary Assets
Documentation Contribution
Programmatic Usage
Statistics
Monitor partial clone usage:Troubleshooting
Object Not Available
Sparse Checkout Conflicts
Performance Issues
Comparison with Git
| Feature | wit | Git |
|---|---|---|
| Partial clone | Yes | Yes (2.19+) |
| Sparse checkout | Yes | Yes |
| Cone mode | Default | Optional |
| On-demand fetch | Automatic | Automatic |
| Object manifest | Yes | Promisor packs |
Best Practices
- Use sparse checkout for large repos you only partially need
- Set blob limits to skip large binaries
- Pre-fetch before offline work with
wit fetch --path - Monitor usage with
wit partial-clone status
Related
- wit clone - Clone repositories
- Large Files - Large file handling
- Monorepo Scopes - Scope filtering