“You cannot with Git as it operates on a whole-repository basis.”
If you have svn, you can use svn export to do this:
svn export https://github.com/foobar/Test/trunk/foo
Notice the URL format:
- The base URL is
https://github.com/ USERNAME/PROJECTNAMEwithout.git/trunkappended at the end
Creds: http://stackoverflow.com/questions/7106012/download-a-single-folder-or-directory-from-a-github-repo