# git sparse-checkout set not working in git 2.27.0

2 messages from 2020-06-11 to 2020-06-11. Participants: Alasdair Hurst, Elijah Newren.
Thread: https://gitlist.dev/t/53662

## Alasdair Hurst, 2020-06-11 16:49

Subject: git sparse-checkout set not working in git 2.27.0
Message-ID: <000801d64010$565b0b70$03112250$@gmail.com>
URL: https://gitlist.dev/e/000801d64010%24565b0b70%2403112250%24%40gmail.com

```
In git 2.27.0 sparse-checkout doesn't seem to work the same as it did in
2.25.0:

 

Version: git version 2.27.0.windows.1 (the same behavior occurs on 2.27.0 on
linux too)

Commands:
-git clone git@repo.com:user/repo <mailto:git@repo.com:user/repo>
--no-checkout --depth 1 sparse-repo

-cd sparse-repo

-git sparse-checkout init

-git sparse-checkout add packages

 

Expected behavior (as seen in 0.25):

-ls
packages

The packages directory is checked out and available the repo root.


Current behavior

-ls

 

No packages directory is checked out and the root is empty.

 


```

## Elijah Newren, 2020-06-11 18:30

Subject: Re: git sparse-checkout set not working in git 2.27.0
Message-ID: <CABPp-BFRX3MPn=jw+Ezdx1pmxVF9SJw7Mxhk5cS5KUrXFJmM=w@mail.gmail.com>
URL: https://gitlist.dev/e/CABPp-BFRX3MPn%3Djw%2BEzdx1pmxVF9SJw7Mxhk5cS5KUrXFJmM%3Dw%40mail.gmail.com
In-Reply-To: <000801d64010$565b0b70$03112250$@gmail.com>

```
On Thu, Jun 11, 2020 at 9:52 AM Alasdair Hurst <alasdairhurst@gmail.com> wrote:
>
> In git 2.27.0 sparse-checkout doesn't seem to work the same as it did in
> 2.25.0:
>
>
>
> Version: git version 2.27.0.windows.1 (the same behavior occurs on 2.27.0 on
> linux too)
>
> Commands:
> -git clone git@repo.com:user/repo <mailto:git@repo.com:user/repo>
> --no-checkout --depth 1 sparse-repo
>
> -cd sparse-repo
>
> -git sparse-checkout init
>
> -git sparse-checkout add packages
>
>
>
> Expected behavior (as seen in 0.25):
>
> -ls
> packages
>
> The packages directory is checked out and available the repo root.
>
>
> Current behavior
>
> -ls
>
>
>
> No packages directory is checked out and the root is empty.

Thanks for the report; this was fixed by commit b5bfc08a97
("sparse-checkout: avoid staging deletions of all files", 2020-06-05),
currently cooking in the 'next' branch of git.git.  See the thread at
https://lore.kernel.org/git/pull.801.v2.git.git.1591324899170.gitgitgadget@gmail.com/
if you want to read up on it.

```
