Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

failed to initialize sparse-checkout

I'm getting the below error when i try to clone a folder "banana" from git repository using sparse filter;

git clone --depth 1 --filter=blob:none --sparse https://github.com/gitexpert/testGithub.git 
cd testGithub
git sparse-checkout set banana

GIT Version : 2.25.1

Error log:

Cloning into 'testGithub'...
fatal: cannot change to '://github.com/gitexpert/testGithub.git': No such file or directory
error: failed to initialize sparse-checkout
like image 485
itgeek Avatar asked Jun 25 '26 19:06

itgeek


1 Answers

The solution proposed by @satbekmyrza worked for me. I upgraded git from 2.25.1 to 2.37.3 and now sparse cloning works.

Unfortunately, the git version that is installed through the standard package repos on Ubuntu is 2.25.1 at the time of writing. In order to upgrade to a version higher than 2.25.1, one must install git from the PPA, as described at Download for Linux and Unix (git-scm.com).

like image 134
outofthecave Avatar answered Jun 28 '26 09:06

outofthecave



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!