Rebuild loose missing tree in Git when there are no other missing objects

My Git repository claims there is a corrupted object: running git fsck --full says that there’s a corrupted loose object in the repo. Since the object is corrupted, I can’t unpack it using git cat-file -t, but removing the file causes fsck to report only:

broken link from tree 93e54230ef...
            to tree 5aec4ad...
missing tree 5aec4ad...

I think this missing tree is the only file that is missing, or rather that there are no dangling commits/blobs, because running git ls-tree 93e54230ef... shows only one line: 040000 tree 5aec4ad... android. Also, the last-modified date on the corrupted file is yesterday, and I haven’t made any changes since then. Unfortunately, I’ve checked the clones I have of this repository, but none of them have the missing object packed or unpacked.

  • Trying to clone a repository in git, getting a error
  • Repair corrupted git repository
  • Go back in history to an undamaged version?
  • How do I prevent my git from corrupting?
  • How to fix git missing blob?
  • What can I do with Git corruption due to a missing object?
  • How can I rebuild a missing git tree with no dangling commits or blobs?

  • Git - Github push history
  • Does git log --branches work?
  • Finding out the name of the original repository you cloned from in Git
  • Git merge conflict since I deleted a file
  • How to use jgit to clone the existing repositories to new github instance?
  • Git in Visual Studio Team Services, Visual Studio 2012 Project - can't deploy from build
  • One Solution collect form web for “Rebuild loose missing tree in Git when there are no other missing objects”

    When all that is missing in Git is a tree, the solution is simply to use write-tree:

    git write-tree
    

    After executing that command, the Git repository should revert to its previous state.

    Git Baby is a git and github fan, let's start git clone.