How to disable sparse checkout after enabled?

Viewed 8607

I enabled a sparse checkout

git init
git remote add <url>
git config --global core.sparseCheckout true
echo "assets" >> .git/info/sparse-checkout
git pull origin master

Git checked out only the assets folder for me

But now, I want to enable full branch checkout again (checkout folders/files), but it doesn't seem to work.

1) first I disabled config

git config --global core.sparseCheckout false

2) removed the entries in .git/info/sparse-checkout

But git didn't checkout any of the other folders/files for me, it seems it is sticking to 'assets' folder.

Could anyone tell me how can I reset/disable this sparse checkout without creating a new repo.?

3 Answers

While it is still experimental as of git 2.27, there is now a command that handles this more transparently/intuitively:

git sparse-checkout disable

My understanding is that you shouldn't have to set core.sparseCheckout manually anymore, it should be enabled, configured and disabled using this new git sparse-checkout command.

https://git-scm.com/docs/git-sparse-checkout

Related