- June 5, 2017
- Posted by: iSummation Team
- Category: Uncategorized
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/.
1 |
$ 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/.
1 |
> $ git status On branch vikas Your branch is based on 'origin/master',> but the upstream is gone. (use "git branch --unset-upstream" to> 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/.
1 |
$ 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/.
1 |
$ 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.