pull git/bitbucket repository partially
Console steps:
cd ~/git/
mkdir partial_test
cd partial_test/
git init
git remote add -f origin https://user:password@git.example.com/folder1/repository1.git
git config core.sparseCheckout true
echo "subfolder1/subfolder2/needed_folder/" >> .git/info/sparse-checkout
git pull origin master
(tested in ubuntu 16.04.5 LTS, git 2.7.4)