I've a large repository with disk space of around 5Gb. I only need few folders from this repository and I'm able to do sparse checkout for those folders. But the diskspace consumption of .git folder is still 5GB. So, is there any way to save disk space and only clone the required folders or any other way?
Steps for my sparse checkout:
git init
git config core.sparsecheckout true
touch .git/info/sparse-checkout
echo path/to/folder1 >> .git/info/sparse-checkout
echo path/to/folder2 >> .git/info/sparse-checkout
git remote add -f <branch name> <url> <==taking too much memory here
git checkout <tag>