Subject: Re: Recover broken git index?

From: Andreas Ericsson <[email-masked]>
Date: Thu, 28 May 2009 11:01:49 +0200

Misha Koshelev wrote:
> Hi, I seem to have an unrecoverable git index. I have attached the
> output of git-fsck --full. There seem to be a lot of missing trees and
> blobs. Any good way to recover?
> 

Start by copying the repository somewhere safe so you don't accidentally
delete things in it.

If it's really the index that's broken, a simple

  git checkout master && git reset --hard

should do the trick.

If it doesn't, it's not the index that's at fault.

Have you done history surgery on this repository (extensive rebasing
or filter-branch'ing)?

Answers to the questions below really should have been in your original
post. Please include them if we're to be able to understand what's going
on:
What OS and platform are you using?
What git version are you using?
How did you first notice this?
What were you doing when you first noticed this?
Is your repository working correctly otherwise (ie, do you only spot
these errors when you run "git fsck --full")?

-- 
Andreas Ericsson                   [email-masked]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Register now for Nordic Meet on Nagios, June 3-4 in Stockholm
 http://nordicmeetonnagios.op5.org/

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.