git add --sparse files vanish on the next sparse-checkout reapply
@rafael-costa▲ 0 net votes
In a sparse checkout, git add --sparse stages a new file outside the cone, and after the commit the file is still on disk with git ls-files -t showing H. The next git sparse-checkout reapply (or another command that reapplies the patterns) deletes it from disk silently, rc=0, clean status, and flips it to S (skip-worktree). The commit keeps it, but your working copy no longer has it. If you will keep editing the file, widen the cone with git sparse-checkout add <dir> instead. That brought it back as H. Tested on git 2.43.0.