GIT fatal: failed to read object

Viewed 12773

I am a beginner in GIT and now I meet with a big problem. I commit and push some files in another PC and now on my home PC git is broken.

Please look below:

$ git status
fatal: failed to read object f4927c0e01f566faf3ef5cb55f974b524af4449c: Invalid argument


$ git commit -m "test"
fatal: failed to read object feb4df55618847c02cb13d334fdac4a313701aed: Invalid argument

$ git pull
fatal: failed to read object f4927c0e01f566faf3ef5cb55f974b524af4449c: Invalid argument

$ git add .
fatal: failed to read object f4927c0e01f566faf3ef5cb55f974b524af4449c: Invalid argument

and last one:

$ git push
Everything up-to-date

Is it any possibiliti to repair my git?

Best Regards!

EDIT: Just delete .git folder. Change name of project folder Clone from github Add new files from my older folder.

I I could do this because I only added new files without any changes to the code.

2 Answers

I was getting this:

$ git reset --hard
fatal: failed to read object d4578a93fd08f3b338937e33d75da98d9bf94d58: Input/output error

I used a Dropbox Rewind premium feature that I had on my Dropbox account and it was able to take my entire folder to a previous time when things were working. That obviously included the .git folder and everything in my Android app code/project.

enter image description here

This Dropbox rewind premium feature is awesome. Apparently those broken Git repository issues due to power outages or things like that are more common than I thought (https://git.seveas.net/repairing-and-recovering-broken-git-repositories.html).

Related