Error inflate data stream error unknown compression method

I am getting Git error: inflate: data stream error (unknown compression method) fatal: failed to read object : Invalid argument error when I try do $ git status. How can I fix it?

I am getting
Git error: inflate: data stream error (unknown compression method) fatal: failed to read object <hach>: Invalid argument error
when I try do $ git status. How can I fix it?

Melebius's user avatar

Melebius

5,9674 gold badges35 silver badges50 bronze badges

asked Jan 19, 2017 at 12:20

lsergeev's user avatar

6

  1. Do a git fsck --full
  2. Did it report a corrupted file?
  3. If so delete the file, go back to step #1.
  4. Do del .git/index
  5. Do git reset

answered Mar 19, 2018 at 20:54

ozba's user avatar

ozbaozba

6,4224 gold badges33 silver badges39 bronze badges

0

I think it happened because maybe your computer or files were corrupted.

First back up your .git folder, then use git fsck --full command to check your file system then delete corrupt files and check it again until your problem disappear

abulkay's user avatar

abulkay

3893 silver badges13 bronze badges

answered Jan 10, 2018 at 5:28

Mohsen Jalalian's user avatar

Mohsen JalalianMohsen Jalalian

9922 gold badges16 silver badges30 bronze badges

After some computer «Blue Screen Of death» episodes, I cannot «Push» commits to a Dropbox origin bare repository. The dialog is:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=manager-st push -v —tags —set-upstream origin Bulk_extract:Bulk_extract
Pushing to D:/Meir/Dropbox/git_repositories/ML.git
sh: warning: setlocale: LC_ALL: cannot change locale (en): No such file or directory
remote: error: inflate: data stream error (unknown compression method)        
remote: fatal: failed to read object 2e7c1be969812b240f6dfa7ca9506de4d30d4a04: Invalid argument        
error: inflate: data stream error (unknown compression method)
fatal: failed to read object 2e7c1be969812b240f6dfa7ca9506de4d30d4a04: Invalid argument
To D:/Meir/Dropbox/git_repositories/ML.git
 ! [remote rejected] Bulk_extract -> Bulk_extract (missing necessary objects)
error: failed to push some refs to ‘D:/Meir/Dropbox/git_repositories/ML.git’

Completed with errors, see above.

Help? Anybody…?

Regards
Meir

I tried to recover the repository that had given problem at the time of the opening of the call. It turned out that I had changed it a bit, but I did a backup after a few attempts to try to study the problem.

Here’s a good deal of the errors reported initially:

$ git fetch
remote: Counting objects: 84379, done.
remote: Compressing objects: 100% (32363/32363), done.
error: inflate: data stream error (unknown compression method)
error: unable to unpack e68ba06d6fc973e561ea7663cd46a6563e4db00a header
fatal: cannot read existing object info e68ba06d6fc973e561ea7663cd46a6563e4db00a
fatal: index-pack failed

You no longer have the problem of SHA1 COLLISION FOUND WITH , however.

The first thing I did was close any application that might require blocking any git object (like Eclipse or SourceTree).

Then I tried to collect garbage:

$ git gc --aggressive
error: bad ref for .git/logs/refs/remotes/origin/hotfix-{branch-1}
fatal: bad object refs/remotes/origin/hotfix-{branch-1}
error: failed to run repack

Without GC, I tried to prune the tree, but also to no avail:

$ git prune
fatal: unable to parse object: refs/remotes/origin/hotfix-{branch-1}

With no more alternatives in sight to try to solve via pure git, I have decided to remove the broken reference and see if I can give prune :

$ rm .git/refs/remotes/origin/hotfix-{branch-1}
$ git prune
error: inflate: data stream error (unknown compression method)
error: unable to unpack e68ba06d6fc973e561ea7663cd46a6563e4db00a header
fatal: loose object e68ba06d6fc973e561ea7663cd46a6563e4db00a (stored in .git/objects/e6/8ba06d6fc973e561ea7663cd46a6563e4db00a) is corrupt

Hmmm, how about GC?

$ git gc --aggressive
Counting objects: 288960, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (222462/222462), done.
Writing objects: 100% (288960/288960), done.
Total 288960 (delta 122354), reused 164323 (delta 0)
Checking connectivity: 288960, done.
$ git prune
Checking connectivity: 288960, done.

Checking fsck to see if everything is fine …

$ git fsck --full
Checking object directories: 100% (256/256), done.
Checking objects: 100% (288960/288960), done.

Confirming that you are back to balance by getting things from the remote …

$ git fetch
remote: Counting objects: 84486, done.
remote: Compressing objects: 100% (32403/32403), done.
remote: Total 84486 (delta 32338), reused 81967 (delta 31026)
Receiving objects: 100% (84486/84486), 14.67 MiB | 563.00 KiB/s, done.
Resolving deltas: 100% (32338/32338), done.

From {endereço do origin}
 * [new branch]            {branch}            -> origin/{branch}
[... diversos outros branches e tags que entraram no projeto depois de 6 meses ...]

So, success.

  

I am especially grateful to @wmsouza for giving me a number of references that during this time were used to help me understand what was happening and finally to be able to recover from the problem in an elegant way.

Recapping

  • Removal of corrupted references :

    $ rm rm .git/refs/remotes/origin/hotfix-{branch-1}
    
  • garbage collection / garbage collector aggressive to collect all corrupted objects

    :

    $ git gc --aggressive
    
  • Check if everything is functional, just in case?

    $ git fsck --full
    
  • 19.04.2018 / 21:25

    Issue:

    When opening a particular project in InfraWorks, the following message is received:

    «Autodesk InfraWorks cannot open the database since some of the support files are corrupted. Please contact technical support.«

    error: bad signature

    fatal: index file corrupt

    error: inflate: data stream error (unknown compression method)

    User-added image

    Causes:

    There are two possibilities for this error:

    1. Another InfraWorks project has been copied/moved mistakenly into the *.git folder of the model (this folder is normally hidden, so in most instances this may not happen).
    2. There is actual corruption in the file.

    Solution:

    If the error message includes similar messaging such as ‘inflate: data stream error (unknown compression method)’ it’s likely a packfile problem. Before trying to fix the corruption, make a backup copy of the model then try the following:

    1. Determine which repository is affected by the issue by looking at the error log.
    2. Find the line that starts with «Git repo:» as this will state the folder to navigate to.
    3. There are 2 git repositories, one in the model.files folder and one in the model.files/unver folder.
    4. Models will generally be stored in the location: C:/Users/<username>/Documents/Autodesk InfraWorks Models/
      • Alternately, the folders may have been added to another preferred hard drive location such as: D:/MyModels/
    5. Navigate to the correct model.files folder in Windows Explorer. 
    6. Right-click on the folder while holding down the Shift key.
    7. From the context menu, select the Open a command window here option.
    8. Paste the following into the window by right-clicking on the title bar of the Command Prompt window and from the context menu select EditPaste:

    «C:Program FilesAutodeskInfraWorks 360Gitbingit.exe» status

    1. This should either return a similar error message as the application indicating this is the corrupt repository or it will give a result indicating the status is 100%. If the latter try the other repository.
    2. Once you have found the correct repository try the following:

    «C:Program FilesAutodeskInfraWorks 360Gitbingit.exe» index-pack

    1. Try to open the model in InfraWorks and confirm everything is working properly.

    Additionally, if the Index file corruption message had text that did not include a ‘data stream’ error, then try the following command in the Command Prompt window:

    1. Enter the text: «C:Program FilesAutodeskInfraWorks 360Gitbingit.exe» reset
    2. Try to open the model in InfraWorks and confirm everything is working properly.

    Note: The git commands assume InfraWorks is installed in the standard directory.

    Products:

    Infraworks 360; InfraWorks;

    Versions:

    2017; 2016; 2019; 2018;

    1. Сделайте копию репозитория в текущем состоянии из того, как вы восстановились с помощью программного обеспечения для восстановления данных, чтобы вы могли, по крайней мере, вернуться к резервной копии
    2. Проверьте, есть ли у вас все хранилище в структуре папок, прежде чем случайно удалять хранилище.

    Вы можете попробовать выполнить следующие команды и удалить поврежденные объекты, но объекты-это ваши файлы данных, но посмотрите, каков результат, на следующей веб-странице, https://itqna.net/questions/1935/git-fetch-inflate-data-stream-error-and-sha1-collision-found

    Удаление поврежденных ссылок :

    $ rm rm .git/ссылки/удаленные устройства/источник/исправление-{ветвь-1} сбор мусора / сборщик мусора, агрессивный для сбора всех поврежденных объектов

    : $ git gc —агрессивная проверка, все ли работает, на всякий случай?

    $ git fsck —полный

     
    The information below was taken from the following page and should be really useful for you and for you to learn about the .git folder as well.
    
    https://git.seveas.net/repairing-and-recovering-broken-git-repositories.html
    
    Repairing and recovering broken git repositories
    
    Whether it's filesystem corruption due to a power outage, an overactive virus scanner, or a simple slip of the keyboard, it is not uncommon to hear about corruption inside the .git directory. It is much rarer to hear about such corruption being caused by git. I personally have never seen it, and it would surely be considered a critical bug if it were to happen.
    
    So, what can we remove while still having something to recover? Well, pretty much everything except the objects directory. And even if you remove files from there, all other objects will be recoverable.
    
    Make backups and try in a copy first
    
    Your repository is already broken. Don't break it any further without first making sure nobody can access it except you, making a backup (tar, rsync) of the repository and first trying the commands in a copy of the repository.
    
     

    $ tar zcvf myrepo.tar.gz мырепо
    $ rsync -av myrepo/ myrepo-копия/
    $ cd myrepo-копия/

     All the files in `.git` are gone!
    
    One of the more interesting (and surprisingly easy to solve!) cases of corruption I've seen is someone losing all the files in the `.git` directory, but no directories or files inside those directories were lost. We never did find out how it happened, but it was surprisingly easy to fix this.
    
    The gitrepository-layout manpage can tell you which files git expects to exist. Below you find out how to restore them when they've gone missing.
    
    HEAD
    
    When `.git/HEAD` is gone, git doesn't even think your repository is a repository. So really, we must fix this first or else we will not be able to use any git commands to salvage the rest.
    
     

    $ rm .git/HEAD
    $ git status

     
    fatal: Not a git repository (or any of the parent directories): `.git`
    This is one of the very few times where touching files inside `.git` is OK. If you know which branch you had checked out, you can simply put that information inside `.git/HEAD`. I had the master branch checked out before deleting the HEAD file.
    
     

    $ echo ‘ref: refs/heads/master’ > .git/HEAD
    $ git status

     
    On branch master
    Your branch is up-to-date with 'origin/master'.
    nothing to commit, working directory clean
    If you don't know which branch (or even commit in detached HEAD state) you had checked out, try a few. If you picked the wrong one, git diff will tell you that there are many uncommitted changes.
    
    index
    
    Should you misplace your index, git thinks that all your files have been deleted from the repository with git rm --cached.
    
     

    $ rm .git/индекс
    $ статус git
    На мастере ветки
    Ваша ветвь обновлена с помощью «origin/master».
    Изменения, которые необходимо внести:
    (используйте «git reset HEAD …», чтобы открепить)

     deleted:    .gitignore
    deleted:    docs/index.rst
    deleted:    setup.py
     

    Неотслеженные файлы:
    (используйте «git добавить…», чтобы включить в то, что будет зафиксировано)

     .gitignore
    docs/
    setup.py
     
     
    To rebuild the index, you can simply do git reset --mixed. This makes the index look like the last commit while leaving the worktree alone. If you had any local changes you git added but did not commit yet, you will need to re-add those.
    
     

    $ сброс git —смешанный
    $ статус git

     
    On branch master
    Your branch is up-to-date with 'origin/master'.
    nothing to commit, working directory clean
    config
    
    When the configuration is gone, you can't really get it back. But you can set the default configuration variables and re-add your remotes. This should get you into a workable state. So let's first do the default configuration.
    
     

    $ git init

     
    Git's init command will create a configuration if none exists. It will not wipe any objects, so it's safe to run in an existing repository. If your repository was a shared repository, you will need to tell git that manually though, using git config core.sharedRepository true.
    
    With the configuration in place, we can re-add our remotes. My corrupt repository has one remote that lives on GitHub, so I'll add it.
    
     

    $ git удаленное добавление источника git@github.com:seveas/whelk.git
    $ git fetch

     
    Are we done? Almost! git branch -vva will tell you that your branches are no longer tracking their remote counterparts. If you have only a master branch, a simple git branch -u origin/master master is enough to set up tracking. If you have many branches, you will want to script this.
    
     

    для напора в $(Git для-каждого-арт —формат ‘%(ссылки:ссылки короткие)’/руководители); делать
    если git Рэв-синтаксический анализ -м —проверка происхождения/$руководителя >/dev/нуль; тогда
    отделение -у ГИТ происхождения/$головой глава
    интернет
    сделано
    упакован-ссылки

     
    If the packed-refs file is gone, you might have lost an awful lot of refs. Try a git fetch to see if some of them come back (tags and remote refs). For local refs, see the recipe below that discusses losing the refs directory.
    
    A folder in `.git` is gone!
    
    Not even two weeks after the case of the missing files, a user popped into #git who had lost everything except .git/objects/ (seriously, how do people do this?!). We managed to recreate everything else, which was of course made easier because he had only a single remote and a single branch. But it just goes to show that you can lose a lot of things and still keep git happy.
    
    In this case it is important though to recover things in the correct order. The order we used was:
    
     

    голова
    ReFS/
    Снова ВОЗГЛАВЬТЕ и проиндексируйте

    ссылки конфигурации

     
    The refs directory contains all your branches, tags and other refs, except for the ones stored in .git/packed-refs. When you lose refs, there are a few strategies to get them back. The simplest one is to fetch from a remote repository (if you have any). This will bring back refs in refs/remotes, and tags that the remote has. When you lost all refs, you will first need to manually `mkdir -p .git/refs/heads` to get git to recognize the repository at all.
    
    For local refs, there are two locations where you can recover the previous values of refs : the reflog and the output of fsck. If you still have your reflogs, you will find the correct value of a ref to on the last line of its reflog. Here's an example of recovering the master branch:
    
     

    $ tail -n1 .git/журналы/ссылки/главы/мастер
    54bc41416c5d3ecb978acb0df80d57aa3e54494c 2c78628255b8cc7f0b5d47981acea138db8716d2

     
    Dennis Kaarsemaker <dennis@kaarsemaker.net> 1446765968  0100  merge upstream/master: Fast-forward
    
    `$ git update-ref refs/heads/master 2c78628255b8cc7f0b5d47981acea138db8716d2`
    The reflog in `.git/logs/HEAD` can show you which branch you had last checked out. This can help you update the HEAD ref.
    
     

    $ хвост -n1 .git/журналы/ГОЛОВА
    7f79f6a992b11aaaf2592075346d83b1ba0f4ff8 a5e28dbe709a544f51b9c44752e14e5cd007a815 Деннис Каарсмейкер dennis@kaarsemaker.net 1448810920 0100 оформление заказа: переход с 7f79f6a992b11aaaf2592075346d83b1ba0f4ff8 на мастер
    $ git символический-ref HEAD ссылки/главы/мастер

     
    If you do not have any reflogs, you can still recover refs by looking at your commit objects. If a commit has no descendants, it could be at the tip of a branch, so a ref should point to it. It could also be a commit that was amended, rebased or simply discarded, so this method may give you some false positives to sort through. So how do you find commits without descendants? Fortunately you don't need to do this manually, `git fsck` is here to help. Let's break a simple repository to show it.
    
     

    $ клон git https://github.com/seveas/whelk.git
    [вывод опущен]
    $ cd щенок/
    $ rm .git/упаковано-ссылки .git/ссылки/главы/мастер
    $ git fsck
    примечание: заголовок указывает на нерожденную ветвь (мастер)
    Проверка каталогов объектов: 100% (256/256), готово.
    Проверка объектов: 100% (589/589), выполнено.
    ошибка: ссылки/пульты дистанционного управления/источник/ЗАГОЛОВОК: неверный указатель sha1
    000000000000000000000000000000000000000000 примечание: Нет ссылок по умолчанию
    , тег
    92d0fe18f9a55177d955edf58048b49db7987d5b, фиксация обрыва aa7856977e80d11833e97b4151f400a516316179, фиксация
    обрыва
    16e449da82ec8bb51aed56c0c4c05473442db90a, фиксация обрыва 864c345397fcb3bdb902402e17148e19b3f263a8
    болтающийся тег be9471e1263a78fd765d4c72925c0425c90d3d64

     
    These dangling commits are the tips of the branches. But which one is which? There's no way to know without looking, so let's create some temporary branches and have a look
    
     

    $ обновление git-ссылки на ссылки/заголовки/восстановление-1 aa7856977e80d11833e97b4151f400a516316179
    $ обновление git-ссылки/заголовки/восстановление-2 16e449da82ec8bb51aed56c0c4c05473442db90a
    $ обновление git-ссылки/заголовки/восстановление-3 864c345397fcb3bdb902402e17148e19b3f263a8
    $ git журнал —график —все —oneline —украсить

     
    In the resulting log, you'll see where these temporary branches point, and you can use git branch -m to give them their correct names back. And those dangling tags? Those are tag objects that you can now recover, the tag object even has the tag name in it!
    
     

    $ git cat-file tag be9471e1263a78fd765d4c72925c0425c90d3d64
    object 34555e0e3315f60ca5810562a36269187c2ced46
    type commit
    tag 2.5
    tagger Dennis Kaarsemaker dennis@kaarsemaker.net 1428783307 0200

     
    Version 2.5
    `$ git update-ref refs/tags/2.5 be9471e1263a78fd765d4c72925c0425c90d3d64`
    logs
    
    If the reflogs are gone, they cannot be recovered. Fortunately, these logs aren't necessary for the normal operation of git and losing them only makes recovering refs harder.
    
    objects
    
    If the objects directory is gone, it's time to give up. This is where your data lives, and with it gone, what's left is useless. If you still have your worktree, you can use it to start a new repository. Delete the `.git` directory and git init to start over.
    
    If the directory is not gone completely, but you have some corrupt or missing objects, see below for tips and tricks on how to recover from this
    
    info
    
    The info/ directory is mostly useless these days, as it is only used for the obsolete dumb http protocol. If you still use this protocol and lost the info/ directory of the repository that is being pulled from, you can recreate it with git update-server-info.
    
    modules
    
    If the modules directory is gone, git can get quite upset. To fix this, move the submodules' worktrees out of the way (or delete them if you're sure you have no changes) and simply run git submodule update to reclone them. Then put your worktrees back if you had local changes, and you can commit those.
    
    worktrees
    
    A feature still under heavy development is support for multiple worktrees for a single repository. Information about these worktrees is stored in the worktrees directory. For each worktree, there is a separate directory containing at least HEAD, index, logs/HEAD, `gitdir` and `commondir`.
    
    HEAD, index and logs/HEAD can be recovered as above. `gitdir` should contain the path to the `.git` file inside the separate worktree and commondir should contain the path to the original .git dir of the repository, usually ../..
    
    Object corruption
    
    The worst kind of corruption in a git repository is corrupt or missing objects. Corrupt objects are incredibly tricky to recover if you do not have a copy of them, so we will focus on restoring missing objects from another copy of the repository so any local-only work is not lost.
    
    So let's first find out which objects are corrupt and remove them (you did read the first section of this article, saying to try this first in a copy of the repository, right?).
    
     

    $ git fsck —полная
    ошибка: завышение: ошибка потока данных (неправильная проверка заголовка)
    ошибка: не удалось распаковать 27c221b1620b8414de002b00aa990fd8e0d768a7
    ошибка заголовка: завышение: ошибка потока данных (неправильная проверка заголовка)
    фатально: свободный объект 27c221b1620b8414de002b00aa990fd8e0d768a7 (хранится в .git/objects/27/c221b1620b8414de002b00aa990fd8e0d768a7) поврежден
    ошибка: .git/объекты/пакет/пакет-0672bd01813664b80248dbe8330bf52da9c02b9f.пакет несоответствие контрольной суммы SHA1
    ошибка: несоответствие индекса CRC для объекта 66e007c864c1460986af0993698234f4442882f1 из .git/objects/pack/pack-0672bd01813664b80248dbe8330bf52da9c02b9f.pack со смещением 1485
    ошибка: завышение: ошибка потока данных (неправильная проверка данных)
    ошибка: не удается распаковать 66e007c864c1460986af0993698234f4442882f1 из .git/объекты/пакет/пакет-0672bd01813664b80248dbe8330bf52da9c02b9f.пакет со смещением 1485
    Проверка объектов: 100% (441/441), выполнено.
    висячая фиксация fe3af8c7274267a4262bc093adcee57511e13211

     
    This repository was intentionally broken by modifying some files with a hex editor. `git fsck` detects this and tells you which files have been tampered with. Any corrupt loose objects can simply be removed, but corrupt packfiles probably also contain some recoverable objects, so we try to recover those before removing the file.
    
     

    $ mv .git/объекты/пакет/пакет-0672bd01813664b80248dbe8330bf52da9c02b9f.pack .
    $ git распаковка-объекты -r
    пакет $ rm-0672bd01813664b80248dbe8330bf52da9c02b9f.pack
    $ rm .git/объекты/27/c221b1620b8414de002b00aa990fd8e0d768a7

     
    With those files now out of the way, `git fsck` will report all missing objects. We can try recovering those from a fresh clone.
    
    `$ git unpack-objects < ../fresh-clone/.git/objects/pack/pack-*.pack`
    If there are still missing objects, you can try adding the current contents of the work directory to your repository:
    
    `$ find -type f -print0 | xargs -0 git hash-object -w`
     

    Comments

    @derrickstolee

    This was referenced

    May 2, 2019

    derrickstolee

    added a commit
    that referenced
    this issue

    May 7, 2019

    @derrickstolee

    …jectsStep
    
    If we have a corrupt loose object, the `git pack-objects` command will fail as it cannot put that object into a pack-file. This stops all future iterations of the `LooseObjectsStep` from succeeding, so users will be stuck in a bad situation.
    
    * Refactor `WriteLooseObjectIds()` to rely on a new `LooseObjectsBatch()` method.
    
    * On failure to create a pack, check all objects in the batch (using `LooseObjectsBatch()` and libgit2) and delete those that fail.
    
    * Start disposing the repo in the dehydrate verb for safety.
    
    * Create a functional test that verifies this behavior. Move the `LooseObjectStepTests` to have a new enlistment for each test, since we are messing with the object store. Part of the issue is that .NET doesn't allow us to move files that are marked as read-only, which becomes problematic as tests create pack-indexes and other files.
    
    Resolves #1079

    derrickstolee

    added a commit
    that referenced
    this issue

    May 9, 2019

    @derrickstolee

    … LooseObjectsStep
    
    These are the same commits as #1094 and #1116, now targeting `releases/shipped`.
    
    If we have a corrupt loose object, the `git pack-objects` command will fail as it cannot put that object into a pack-file. This stops all future iterations of the `LooseObjectsStep` from succeeding, so users will be stuck in a bad situation.
    
    * Refactor `WriteLooseObjectIds()` to rely on a new `LooseObjectsBatch()` method.
    
    * On failure to create a pack, check all objects in the batch (using `LooseObjectsBatch()` and libgit2) and delete those that fail.
    
    * Start disposing the repo in the dehydrate verb for safety.
    
    * Create a functional test that verifies this behavior. Move the `LooseObjectStepTests` to have a new enlistment for each test, since we are messing with the object store. Part of the issue is that .NET doesn't allow us to move files that are marked as read-only, which becomes problematic as tests create pack-indexes and other files.
    
    Resolves #1079

    Recently, I was facing the git fatal error when I pull new changes from remote repository, This is probably due to my computer was shutdown due to power cut, I had faced similar error previously and I’ll explain that we well in my next post

    I was getting the following error when I use git pull command

    Error when loading gists from https://gist.github.com/.

    $ git pullremote: Counting objects: 85, done.remote: Compressing objects: 100% (37/37), done.remote: Total 85 (delta 63), reused 69 (delta 48)Unpacking objects: 100% (85/85), done.error: inflate: data stream error (unknown compression method)fatal: failed to read object 8b0fd4094630fea108b60faa15535ffbc85d87cb: Invalid argumenterror: http://myremoterepo.com/project.git did not send all necessary objects

    I was able to switch to another local branch, I was able to create new local branch from few remove branches but not all. I was also able to make new commit in local repository. This means I git repository is not crashed fully but there are some issues with refs (SHA1 hash pointers).

    For the branches where you can not pull or fetch, you should get the following output.

    Error when loading gists from https://gist.github.com/.

    &gt; $ git status On branch vikas Your branch is based on ‘origin/master’,&gt; but the upstream is gone.   (use &quot;git branch unsetupstream&quot; to&gt; fixup) nothing to commit, working directory clean

    Now, backup your .git folder first. Then use git fsck command to see if there is an error. I got following output

    Error when loading gists from https://gist.github.com/.

    $ git fsck fullerror: inflate: data stream error (unknown compression method)error: unable to unpack 38fe6f16c7e8246d61150f0bc42629dbb532b5ce headererror: inflate: data stream error (unknown compression method)fatal: loose object 38fe6f16c7e8246d61150f0bc42629dbb532b5ce (stored in .git/objects/38/fe6f16c7e8246d61150f0bc42629dbb532b5ce) is corrupt

    I deleted the file .git/objects/38/fe6f16c7e8246d61150f0bc42629dbb532b5ce and continuing these steps until I get following output:

    Error when loading gists from https://gist.github.com/.

    $ git fsck fullChecking object directories: 100% (256/256), done.Checking objects: 100% (168543/168543), done.error: refs/remotes/origin/staging: invalid sha1 pointer 0000000000000000000000000000000000000000error: refs/remotes/origin/development: invalid sha1 pointer 0000000000000000000000000000000000000000error: refs/remotes/origin/master: invalid sha1 pointer 0000000000000000000000000000000000000000error: bad ref for refs/remotes/origin/stagingbroken link from  commit 8b0fd4094630fea108b60faa15535ffbc85d87cb              to  commit bac9f287963b1abb9e4b376b44b4a6500018e9feChecking connectivity: 169821, done.dangling blob 750718546640b5b14c19cbdb9958d7bcc4b1114cdangling blob e313786318d4c76004728f15a25c6fa68c88b67edangling blob ee3fd85992b48173f6c344a9f4a2f9667d4e1940dangling blob cd4898a3ec525e559292337c0bc6b68a77270b52dangling blob 9973506f35af1bf4e7790be57b02c70852843f92dangling blob 47ca4080b9a528efe23c9f7dce994815f5f9162adangling blob 39d6807d215a7e74fb987d951a90e1d3e24a97ebdangling blob c0d650286c3702d56b827eded27eaa9515212847dangling commit 53db70d776ec7a59c10db106ef2585abea1ffddd…

    Output says that 3 remote rerfs are invalid. I removed those 3 refs (.git/refs/remotes/origin/master, .git/refs/remotes/origin/staging, .git/refs/remotes/origin/development) and voila! I was able to pull and push.

    Понравилась статья? Поделить с друзьями:
  • Error indirection requires pointer operand int invalid
  • Error indexing must appear last in an index expression
  • Error index was outside the bounds of the array
  • Error index row requires bytes maximum size is 8191
  • Error incorrect verification number entered