I realize that similar questions has been asked before: How do I clone a subdirectory only of a Git repository? However I couldnt find the answer to my specific question so please do not mark it as duplicate.
I have a subfolder called statics/ in my repo. I want the files of that subfolder end up in the root of my local repo.
I did echo statics/ >> .git/info/sparse-checkout
but I end of with /statics/file.css
in my local repo when I do a pull. I just want /file.css
.
How do I do this?
Reference of commands used:
git init
git remote add -f https://github.com/xxx/xxx.git
git config core.sparsecheckout true
echo statics/ >> .git/info/sparse-checkout
git pull origin master