Lets assume we have a Git repo with a three-level subfolder:
|_
|_Folder1
|_Folder2
|_ SubFolder2
|_ SubSubFolder2
I need to sparse checkout this folder and place it into a different location inside C:\MyRepo
folder (on Windows) - get rid of leading Folder2 directory:
C:\MyRepo
|_ SubFolder2
|_ SubSubFolder2
Is that possible somehow or Git sparse checkout always respect original (remote repo) folder structure and that cannot be changed?
P.S. I've tried the following standard code:
git clone --no-checkout --sparse <remoteRepoURL> "C:\MyRepo"
cd /d "C:\MyRepo"
git sparse-checkout set "Folder2/SubFolder2/SubSubFolder2"
git checkout
But I get original (remote repo) folder structure:
C:\MyRepo
|_Folder2
|_ SubFolder2
|_ SubSubFolder2
Is there a way to change that default behaviour?
P.P.S. There was a similar question asked 7 years ago - still no clear answer there..