the OS of my computer is windows, and file name in repo maybe invalid in windows, so I enable core.sparsecheckout and edit .git/info/sparse-checkout by hand to checkout specified directory, and it's worked well.
recently I updated git for windows and followed this post. But the command git sparse-checkout init --cone failed, and output error: invalid path '/path/of/invaild/filename'.
So, could this command skip invalid filename by some special tricks? or it's just a bug that I should waiting for developers to fix it?