Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git clone failed while unpacking - lack of space - how to recover without a full clone?

Tags:

git

I cloned a repo with git yesterday and ran out of space on my VMs HDD. I've since moved the repo and have enough space. git clone ran out of space during unpacking the downloaded objects. The thing is, git thinks it's up to date, but git status lists pages of deleted files.

Git pull doesn't work as it thinks it's up to date. What can I do so I don't have to clone the entire repository again?

like image 506
Edward Williams Avatar asked Jun 30 '11 21:06

Edward Williams


People also ask

Can you resume a git clone?

There is currently no way to resume a git clone using git, but there is a neat trick you can use instead of cloning directly -- using git bundle files. Here is how you would do it. Once this is done, you can delete the "clone. bundle" file, unless you think you will need to perform a fresh clone again in the future.

What is a bare git clone?

git clone --bare origin-url : You will get all of the tags copied, local branches master (HEAD) , next , pu , and maint , no remote tracking branches. That is, all branches are copied as is, and it's set up completely independent, with no expectation of fetching again.


1 Answers

Try:

git reset --hard HEAD

This should update your working copy.

like image 171
Greg Hewgill Avatar answered Sep 28 '22 21:09

Greg Hewgill