For all that struggle with theoretical file paths and examples like I did, here a real world example: Microsoft offers their docs and examples on git hub, unfortunately they do gather all their example files for a large amount of topics in this repository:
https://github.com/microsoftarchive/msdn-code-gallery-community-s-z
I only was interested in the Microsoft Dynamics js files in the path
msdn-code-gallery-community-s-z/Sdk.Soap.js/
so I did the following
create a
msdn-code-gallery-community-s-zSdkSoapjs\.git\info\sparse-checkout
file in my repositories folder on the disk
git sparse-checkout init
in that directory using cmd on windows
The file contents of
msdn-code-gallery-community-s-zSdkSoapjs\.git\info\sparse-checkout
is
Sdk.Soap.js/*
finally do a
git pull origin master