Learning center

Can a reviewer use a sparse checkout of a monorepo?

A sparse checkout is useful for inspection inside a large repository. Decide which callers the review depends on before interpreting a working-tree search. In a full clone, Git can read files in the commit even when the sparse checkout leaves them out of the working tree.

Check a caller outside the selected directories#

Imagine a diff moves a money conversion helper in libs/money. A maintainer with only services/cart and libs/money checked out runs a filesystem search and finds one caller. An unchanged invoice service lives outside the selected directories.

git grep -n -e centsToDollars review -- services libs

Searching the named tree review can show the invoice caller as well as the cart caller, provided the objects exist. In an approved full checkout, either read the specific caller with git show review:services/invoice/render.ts or include the invoice directory before testing it. This search locates textual uses of the symbol. Dynamic calls, re-exports and generated consumers may need a build or a language-aware search. Git sparse-checkout working-tree behavior · Git grep over tree objects

Ask a review tool what it searches: the worktree, the pinned commit’s objects, or a separate index. Use the same two-caller fixture to check its answer. If the tree search needs a network fetch, check the partial clone separately.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading