6

I got this error with open SourceTree

$ 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

Sagar Thakkar
  • 137
  • 1
  • 3
  • 9
  • try doing it from command line – Daniyal Syed Jun 14 '17 at 12:23
  • @DaniyalSyed I tried that but not works – Sagar Thakkar Jun 14 '17 at 12:24
  • what error are you getting on command line – Daniyal Syed Jun 14 '17 at 12:24
  • @DaniyalSyed -- > $ 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 ------------------------------------------------------------------------------------------I removed all these corrupt objects and also use "$ git reset --hard", this returns "fatal: Could not reset index file to revision 'HEAD'." – Sagar Thakkar Jun 14 '17 at 12:27
  • check this https://stackoverflow.com/questions/23725925/git-repository-corrupt-incorrect-header-check-loose-object-is-corrupt – Daniyal Syed Jun 14 '17 at 12:30

5 Answers5

5

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
Yash Patel
  • 161
  • 1
  • 4
2

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.

smilyface
  • 5,021
  • 8
  • 41
  • 57
0

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

SalluBhai
  • 1
  • 5
0

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

0

I got this issue because I accidentally removed the git/objects folder. When I restored it from the Recycle Bin it worked again.

Joel Wiklund
  • 1,697
  • 2
  • 18
  • 24