133794m3r
133794m3r

Reputation: 5118

git has a corrupted lose object that cannot be repaired

~$ git commit .
error: inflate: data stream error (incorrect data check)
error: corrupt loose object '26f0654cde5d83f2ed8d971474d9d08a76644087'
fatal: object 26f0654cde5d83f2ed8d971474d9d08a76644087 is corrupted

The object in question doesn't exist and I've been doing commits every other day or so.
Since it doesn't list where this object supposedly is, I don't know what do with it.
I guess my last one was on teh 30th of last month, so I've been pretty off balance as of late but still I don't know why it's doing what it's doing right now.

I've tried git unpack-object -r < objectname and it does nothing. Since the object doesn't exist ANYWHERE on my hdd.


The original bit is now changed:

Nom, I've seemed to have just found it. I didn't realize that it was literally doing 26 as /26/ instead of itself. Apparently the file was made on the 1st of December and since I don't have said object since the last external backup, I believe was a few days before.
What's the best way to go about this?

Upvotes: 3

Views: 6335

Answers (2)

Arthur
Arthur

Reputation: 1342

Try

git stash

This worked for me. It stashes anything you haven't committed and that got around the problem.

Upvotes: 1

Adam Dymitruk
Adam Dymitruk

Reputation: 129526

You will need to take a look at what object this is. You need to determine if it's a blob, tree, commit or (unlikely) a signed or messaged tag. Git has low level manipulation commands to do this.

Take a look at this post.

I would recommend doing a filter-branch or rebase -i --preserve-merges to clean up the history so all sha-1s resolve to proper objects.

Upvotes: 0

Related Questions