Contact Us

Let us know to help you out quickly!

 Vikas Patel     Feb,08 2017

Troubleshooting Git Fatal Error: Failed to Read Object Xxx: Invalid Argument

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

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.

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

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

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.