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.
First of all the problem, your facing is corrupted git repository. It's something odd that many can face, one of the reason when the laptop or PC power outage can cause.
There are certain steps you can follow which can help you to solve the problem:
What you can do is to replace the object in .git / refs / heads / my-working-branch" with ".git / logs / HEAD
and submit the successful object.
After step1 your git status -s
and other commands to return to normal, you can use gitk
or other gui tool or just git log will show you the commits.
Then use the git fsck --full
command to see if there will be the same as the title of the error.
If you found the problem then you need to delete the problem in .git / objects /" .
Then repeat the step 3, until there is no error with the title, to this Git repair is complete.
Fixing broken GIT repo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With