What Scalar is
Scalar (originally a Microsoft tool, bundled with Git in 2.38+) is a wrapper that applies the full performance stack — partial clone, sparse checkout, sparse index, fsmonitor, commit-graph, MIDX, geometric repack, background maintenance — with one command. It is the recommended starting point for cloning a large repository.
Cloning
scalar clone https://example.com/big.git
cd big/src
scalar list
Note the src/ subdir — Scalar layers a directory above for its metadata. The actual working tree lives in src/.
What Scalar configures
--filter=blob:nonepartial clone.--sparsewith cone mode and sparse index.core.fsmonitor=true.core.untrackedCache=true.- Commit-graph with changed-path Bloom filters.
- Multi-pack-index with bitmaps.
git maintenance startfor background upkeep.feature.manyFiles=true.
Registering an existing repo
cd existing-big-repo
scalar register
scalar list
scalar unregister
Use this when you already cloned and want to retrofit Scalar's settings. register writes the config and starts maintenance.
Diagnostics
scalar diagnose
scalar reconfigure
diagnose bundles config, repo stats, and recent maintenance logs into a zip for support. reconfigure reapplies recommended settings, useful after Git upgrades.
When to use
- Repos with millions of files.
- Repos with hundreds of GB of history.
- CI runners cloning large repos repeatedly (combined with cache).
- New team members onboarding to a big monorepo.
When not to
Small repos where the optimization stack is overkill. Repos that require the full working tree (build systems that scan everything). Servers that do not support partial clone or sparse upload.
Common mistakes
Treating Scalar as magic — when something breaks, you still need to understand the underlying features. Mixing manual git gc with Scalar's maintenance schedules. Forgetting that the working tree is src/, not the top of the Scalar enlistment.
Related
See "Git in a monorepo" and every Performance page — Scalar enables most of them.