When viewing the file change history, I encountered an error (the actual data was replaced with words for convenience):

error: inflate: data stream error (header check check)
error: failed to read object sum1 at offset offset from .git / objects / pack / pack-sum2.pack
fatal: packed object sum1 (stored in .git / objects / pack / pack-sum2.pack) is corrupt

There are fully working clones of this repository. How to restore this instance?

    1 answer 1

    only the archive with objects is damaged (in fact, only one object: commit or tree or blob ). in this situation, the easiest way is to replace it from a clone with up to date information.

    1. just in case, save the current contents of the .git/objects/pack directory
    2. copy the contents of this directory from the clone with the current information
    3. check that "everything is in order." for example:

       $ git fsck --full --no-dangling Checking object directories: 100% (256/256), done. Checking objects: 100% (11098/11098), done. 
    4. delete saved directory contents

    more details for more severe cases:

    • Transfer? Or do you yourself have encountered such a problem? - Nick Volynkin
    • @NickVolynkin himself. - aleksandr barakin