Reputation: 137
$ git fsck --full
error: inflate: data stream error (incorrect header check)
error: unable to unpack 06c147f2771e280dfb4758c9a83b94346993d172 header
error: inflate: data stream error (incorrect header check)
fatal: loose object 06c147f2771e280dfb4758c9a83b94346993d172 (stored in .git/objects/06/c147f2771e280dfb4758c9a83b94346993d172) is corrupt
also, try this, and remove the all corrupted objects. after removing objects i write this command,
$ git reset --hard
error: unable to read sha1 file of 3X/3X.Core/Resources/Resource.Designer.cs (d46f74436ae02ec61a659a8a487aee5747e2feda)
error: unable to read sha1 file of 3X/3X.Core/Resources/Resource.resx (63342162564404ccae4917489dc78ebb65075f8a)
error: unable to read sha1 file of 3X/3X.Web/Views/Job/ConfirmationAdvice.cshtml (ff39e42f5cf0e0703bd9dfe84a4b746ff91eea40)
error: unable to read sha1 file of 3X/3X.Web/Views/Job/Create.cshtml (3a97827faac6c62fd24f347dd0b0951c27c03751)
error: unable to read sha1 file of 3X/3X.Web/Views/Job/DataEntry.cshtml (89f381bafaeff53eeaf64a26d8c9608e9e86b6a1)
error: unable to read sha1 file of 3X/3X.Web/wwwroot/js/viewjs/Job/create.js (1b62c618c31add2ca28d107c1a49604492409ecf)
fatal: Could not reset index file to revision 'HEAD'.
and got above error
Upvotes: 6
Views: 25755
Reputation: 1554
I'm not sure why this did the trick but it was the solution.
I had an issue where the git version of 2.34.1 would NOT work suddenly for some reason.
I was able to upgrade to the latest git, version 2.46.0 and then it worked!!!
Steps to do this:
sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt upgrade git
Upvotes: 0
Reputation: 1875
I got this issue because I accidentally removed the git/objects
folder. When I restored it from the Recycle Bin
it worked again.
Upvotes: 0
Reputation: 69
Tried all answers and none worked with me.
Finally figured out that the problem is that you have probably configured your Source Tree repo to be located at repo_local_url/.git
The solution is to make it point at repo_local_url instead
Upvotes: 0
Reputation: 161
Try with removing your index file which is in .git folder
Windows System:
del .git\index
git reset
Linux System:
rm -f .git/index
git reset
And if you have deleted index file manually then you need to do
git reset
Upvotes: 5
Reputation: 1
Here is the solution that worked for me i opened my server and went to .git/ and downloaded index file from there then deleted the local .git/index file manually and replace the file with the downloaded index file
Upvotes: 0
Reputation: 5521
It should be corrupted. Try removing this .git/objects/06/c147f2771e280dfb4758c9a83b94346993d172
If you are getting same error with another object try removing all those and fetch again.
Upvotes: 2