Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub: Clone succeeded, but checkout failed

I am having some problems working with git clone.The files are downloaded in my local git folder. Running the command

git checkout -f HEAD gives me-

Error:

'The unable to write new index file error caused by the lack of disk space'.

I've manually removed big files from my computer, but still getting the same error.

Cloning into 'ffmpeg'... remote: Counting objects: 7890, done.   remote: Compressing objects: 100% (4412/4412), done. Receiving objects: 100% (7890/7890), 299.75 MiB | 24.19 MiB/s, done. remote: Total 7890 (delta 3346), reused 7846 (delta 3317) Resolving deltas: 100% (3346/3346), done. Checking out files: 100% (7019/7019), done. fatal: unable to write new index file warning: Clone succeeded, but checkout failed. You can inspect what was checked out with 'git status' and retry the checkout with 'git checkout -f HEAD' 
like image 527
jamie_y Avatar asked Feb 26 '14 12:02

jamie_y


People also ask

What is the use of git checkout command?

The git checkout command lets you navigate between the branches created by git branch . Checking out a branch updates the files in the working directory to match the version stored in that branch, and it tells Git to record all new commits on that branch.


2 Answers

For me this was due to long file names and doing a simple config as below resolved it

 git config --system core.longpaths true 
like image 101
Jai Prakash Avatar answered Oct 06 '22 12:10

Jai Prakash


When you clone, git gets all the objects from the remote end (compressed and stashed into the .git directory). Once it has all the pieces, it proceeds to unpack all files needed to (re)create the working directory. It is this step that fails, due to not having enough space. This might be due to a disk that is full, or a disk quota exceeded (on shared machines, quotas are often enforced to avoid having users grab more than their fair share of space).

Delete your cruft. Make sure you aren't trying to squeeze the Linux kernel or some such monster repository into your few megabytes of account space.

like image 33
vonbrand Avatar answered Oct 06 '22 12:10

vonbrand