I am getting this error in my git repository:
22:09:15 $ git status
# On branch master
error: Could not read 8124cc15c63be92d534e4cdfa33c38d54deee122
error:
I got a similar error in my Homebrew install’s Git repository. Rather than restoring all the missing objects one by one, I found it easier to simply delete the .git directory and create it again by re-cloning from Homebrew’s public repository. These were my steps:
git remote -v, which contains the names and URLs of your remotes, so you can manually add them back later..git directory (or rename it to .git-broken and delete it later). On the command-line, this is rm -rf .git.git clone https://github.com/Homebrew/homebrew.git or whatever URI.homebrew named after the repository. You want just the .git directory from that; your local files are already okay. So mv homebrew/.git .git, and then delete the homebrew folder.git remote add .git reset HEAD^ and saving the working directory to a stash again with git stash save .If you run git fsck, you should see no errors:
$ git fsck
Checking object directories: 100% (256/256), done.
Checking objects: 100% (197135/197135), done.
Checking connectivity: 197162, done.
$
And git stash list, git branch, and git remote -v should show the same output as before.