Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fixing the Git error "error: unable to find"

Tags:

git

I get the following error when I do a git pull origin master.

error: Unable to find a47058d09b4ca436d65609758a9dba52235a75bd under http://myweb.com/myapp.git
Cannot obtain needed blob a47058d09b4ca436d65609758a9dba52235a75bd
while processing commit 041d57dd5bed9d6c75fe7cce944b2b2904ae3a62.
error: Fetch failed.

Everything has been working fine up until a few minutes ago. I did not do anything out of the ordinary. I've been doing my usual commit push and pull, and now I'm suddenly getting this error.

What does this error mean? What are the steps to troubleshooting/correcting this error?

like image 989
John Avatar asked Aug 14 '12 16:08

John


1 Answers

Like Adam said, recover the object from another repository/clone.

Don't forget to take into account packs. So, a more generalized procedure is this:

On a 'complete' Git database:

git cat-file -p a47058d09b4ca436d65609758a9dba52235a75bd > tempfile

And on the receiving end:

git hash-object -w tempfile
like image 198
sehe Avatar answered Sep 28 '22 23:09

sehe