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?

Answers


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.


Try

git stash

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


Need Your Help

End-of-file command in JSON HTTP POST request from putty

json http post putty eof

It is merely a childish question, but I have stuck upon an HTTP POST request through putty command line. After performing the initial request:

Ajax method is not working in FF

javascript jquery ajax internet-explorer firefox

I am using following JS code to call a web handler.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.