Sparse checkout in Git 1.7.0?

Posted by davr on Stack Overflow See other posts from Stack Overflow or by davr
Published on 2010-02-25T18:30:19Z Indexed on 2010/03/16 23:01 UTC
Read the original article Hit count: 555

Filed under:
|
|

With the new sparse checkout feature in Git 1.7.0, is it possible to just get the contents of a subdirectory like how you can in SVN? I found this example, but it preserves the full directory structure. Imagine that I just wanted the contents of the 'perl' directory, without an actual directory named 'perl'.

-- EDIT --

Example:

My git repository contains the following paths

repo/.git/
repo/perl/
repo/perl/script1.pl
repo/perl/script2.pl
repo/images/
repo/images/image1.jpg
repo/images/image2.jpg
repo/doc/
repo/doc/readme.txt
repo/doc/help.txt

What I want is to be able to produce from the above repository this layout:

repo/.git/
repo/script1.pl
repo/script2.pl

However with the current sparse checkout feature, it seems like it is only possible to get

repo/.git/
repo/perl/script1.pl
repo/perl/script2.pl

which is NOT what I want.

Thanks.

© Stack Overflow or respective owner

Related posts about git

Related posts about sparse-checkout