I did a Git pull when I was near my quota, and as a result (so I think), got a corrupted file:
$ git pull walk dffbfa18916a9db95ef8fafc6d7d769c29a445aa fatal: object d4a0e7599494bfee2b5351113895b43c351496b3 is corrupted $ git fsck --full bad sha1 file: .git/objects/66/b55c76947b1d38983e0944f1e6388c86f07a1b.temp fatal: object d4a0e7599494bfee2b5351113895b43c351496b3 is corrupted $ git cat-file -t d4a0e7599494bfee2b5351113895b43c351496b3 error: unable to find d4a0e7599494bfee2b5351113895b43c351496b3 fatal: git cat-file d4a0e7599494bfee2b5351113895b43c351496b3: bad file
How can I solve this corruption?
.git/objects/66/b55c76947b1d38983e0944f1e6388c86f07a1b.temp was zero bytes; deleting it did nothing to solve my problem (same errors).
In its simplest form, git hash-object would take the content you handed to it and merely return the unique key that would be used to store it in your Git database. The -w option then tells the command to not simply return the key, but to write that object to the database.
You can use "find" for remove all files in the /objects
directory with 0 in size with the command:
find .git/objects/ -size 0 -delete
Backup is recommended.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With