# sparse checkout bug?

2 messages from 2011-09-24 to 2011-09-24. Participants: Jay Soffian, Joshua Jensen.
Thread: https://gitlist.dev/t/28486

## Jay Soffian, 2011-09-24 19:50

Subject: sparse checkout bug?
Message-ID: <CAG+J_DwRPq69TUMOeqU5O9pv=cHZWEP1VJ1_NRaJv5BSFhF00g@mail.gmail.com>
URL: https://gitlist.dev/e/CAG%2BJ_DwRPq69TUMOeqU5O9pv%3DcHZWEP1VJ1_NRaJv5BSFhF00g%40mail.gmail.com

```
I wanted to exclude a single massive directory from a checkout (the
LayoutTests directory from WebKit, which includes 130k files), so I
tried:

$ git config core.sparsecheckout true
$ echo '*' > .git/info/sparse-checkout
$ echo '!LayoutTests' >> .git/info/sparse-checkout
$ git read-tree -m -u HEAD

But LayoutTests is not being excluded. I also tried every variation of
including leading/trailing slash and trailing '*'.

Simple repro:

git init sparse-test && cd sparse-test &&
touch foo && mkdir bar && touch bar/baz &&
git add foo bar/baz &&
git commit -m initial &&
git config core.sparsecheckout true &&
echo '*' > .git/info/sparse-checkout &&
echo '!bar' >> .git/info/sparse-checkout &&
git read-tree -m -u HEAD &&
ls -1R
foo

bar:
baz

j.

```

## Joshua Jensen, 2011-09-24 20:19

Subject: Re: sparse checkout bug?
Message-ID: <4E7E3B46.1040002@workspacewhiz.com>
URL: https://gitlist.dev/e/4E7E3B46.1040002%40workspacewhiz.com
In-Reply-To: <CAG+J_DwRPq69TUMOeqU5O9pv=cHZWEP1VJ1_NRaJv5BSFhF00g@mail.gmail.com>

```
----- Original Message -----
From: Jay Soffian
Date: 9/24/2011 1:50 PM
> I wanted to exclude a single massive directory from a checkout (the
> LayoutTests directory from WebKit, which includes 130k files), so I
> tried:
>
> $ git config core.sparsecheckout true
> $ echo '*'>  .git/info/sparse-checkout
> $ echo '!LayoutTests'>>  .git/info/sparse-checkout
> $ git read-tree -m -u HEAD
>
> But LayoutTests is not being excluded. I also tried every variation of
> including leading/trailing slash and trailing '*'.
>
This bug has very recently been discussed on the mailing list.

As a workaround, use:

/*

instead of:

*

You said you have tried this already, but it works for me.  The only 
thing I do in addition is this:

/*
!LayoutTests/

-Josh

```
