El conjunto de trabajo del monorepo
En un monorepo, los desarrolladores individuales suelen tocar un subconjunto pequeño — una o dos apps, un puñado de librerías. Sparse checkout puebla solo esas rutas en el árbol de trabajo, dejando el resto como entradas skip-worktree en el índice.
Setup en modo cono
git sparse-checkout init --cone --sparse-index
git sparse-checkout set apps/web libs/ui libs/api
git sparse-checkout add apps/admin
git sparse-checkout list
Combinado con partial clone
git clone --filter=blob:none --sparse https://example.com/big.git
cd big
git sparse-checkout init --cone --sparse-index
git sparse-checkout set apps/web
Reconfigurar
git sparse-checkout reapply
git sparse-checkout disable
Uso en CI
git clone --no-checkout --filter=blob:none "$REPO_URL" .
git sparse-checkout init --cone --sparse-index
git sparse-checkout set "$AFFECTED_DIR"
git checkout main
Integración con editor e IDE
La mayoría de editores honran sparse checkout transparentemente — los archivos fuera del cono simplemente no existen en disco.
Auditoría
git sparse-checkout list
git ls-files -t | head
git update-index --no-skip-worktree path/file
du -sh .
Errores comunes
Usar modo no-cono sin buena razón. Olvidar habilitar sparse index.