I have my Git repository which, at the root, has two sub directories:
/finisht
/static
When this was in SVN, /finisht
was chec
So i tried everything in this tread and nothing worked for me ... Turns out that on version 2.24 of Git (the one that comes with cpanel at the time of this answer), you don't need to do this
echo "wpm/*" >> .git/info/sparse-checkout
all you need is the folder name
wpm/*
So in short you do this
git config core.sparsecheckout true
you then edit the .git/info/sparse-checkout and add the folder names (one per line) with /* at the end to get subfolders and files
wpm/*
Save and run the checkout command
git checkout master
The result was the expected folder from my repo and nothing else Upvote if this worked for you