A file can disappear from your working directory while Git still tracks it. A sparse checkout keeps a selected part of a repository in the working tree. Git leaves other tracked files out of that local view and ignores their absence. Even git commit -a does not record those omitted paths as deleted.
The working tree is one view
The working tree contains files you can open directly. The index records tracked paths for the next commit. Commits provide another view of the repository. Git’s sparse checkout guide explains that omitted tracked files remain represented in the index. A sparse index can represent a whole omitted directory with one entry, so the index may look different internally while preserving the tracked paths.
This distinction matters when you search the filesystem. A missing path tells you what is present in your working tree. It does not, by itself, tell you whether Git tracks that path or whether the current commit contains it.
The selection controls what appears
In the default cone mode, a sparse checkout selects directories. Git also includes files directly under their parent directories and at the repository root. Run git sparse-checkout list to see the selected directories or patterns. Git’s command reference describes add as a way to include another directory and disable as a way to restore all tracked files to the working tree.
What to do
- From the repository root, run
git sparse-checkout listto inspect the selection. A path outside it may have been omitted from your working tree. - Run
git ls-files --cached -- docs/guide.md, replacing the example path with yours. The ls-files reference says--cachedshows paths in Git’s index. If the path appears, Git still tracks it. - Run
git show HEAD:docs/guide.mdto inspect that path in the current commit. The show reference documents this commit-and-path form. If it displays the file, the current commit contains it. - If you need the directory in your working tree, run
git sparse-checkout add docs. Check your working changes before altering the selection, because the command updates the working directory.

The Campfire
No commentsNobody has pulled up a log by this one yet. Be the first to say what you make of it.
Held for the desk. It appears after a look.