tags:

views:

351

answers:

1

My app, in my filesystem, works just fine. All tests pass.

I'm a sole developer, using Git mostly to use Heroku as well as for backup.

Git has stopped working because of corrupt objects.

I'm getting errors that look like this:

steven-nobles-imac-200:drominay steven$ git push heroku master
error: inflate: data stream error (invalid distance too far back)
fatal: object 990ad2766afa2e2002eea265225ad160e73eacd2 is corrupted
error: pack-objects died with strange error

(And many other errors, all citing corrupted objects.)

How do I get Git to throw out the corrupt objects and replace them with new objects built from the working copy of my app?

Git init didn't solve the problem.

Thanks!

+6  A: 

You need to use git-fsck. The manual has details, but the gist is that git-fsck will make sure that the repository is internally consistent and list the missing objects, then you may use git hash-object -w <correct-file> to put the file given into the repository. If the file given to hash-object really is the one that was corrupt, your repository is now complete again :).

Andrew Aylett