I understand how to configure a sparse checkout in Git, but I was wondering if it's possible to eliminate the leading directories. For example, say I have a Git repository with a folder structure like so:
- folder1/foo
- folder2/foo/bar/stuff
- folder3/another/foo/bar/stuff2
And I only want the contents inside stuff2
. For sparse checkout of those directories, the .git/info/spare-checkout
file would look like this:
folder3/another/foo/bar/stuff2/
My problem is after I'm finished with the sparse checkout, I don't see stuff2
or the contents of stuff2
inside the root of my directory; I see folder3
and then all of the subdirectories leading up to stuff2
.
I'm guessing the answer to this question is that it's not possible with Git, but I just wanted to make sure. This is one (and only) behavior of SVN that I miss; the ability to run svn co https://url.com/myrepo/folder3/another/foo/bar/stuff2 .
and have the contents dumped into the current directory.