Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git reset --hard error: Could not parse object

This is not the first time I am doing a hard reset on my repo but this time, I am getting an error. I am working on an iOS Project. I am doing the reset from terminal. How do I fix the fatal error

fatal: Could not parse object 'e88056ac5d58fb0bbd23d3fe929eac01712d964'
like image 355
learner Avatar asked Sep 17 '14 21:09

learner


3 Answers

I have same problem and fixed.

This problem occurs when there have been changes like force-pushes to a git repo which is referenced in a Gemfile.

The solution is is to comment that gem line in Gemfile, run bundle, uncomment it and bundle again. Then the Gemfile.lock will reference a valid git revision.

Found in this link https://semaphoreci.com/docs/fail-could-not-parse-object.html

like image 154
Jiggs Avatar answered Oct 28 '22 16:10

Jiggs


For me, the problem was that on my local machine I needed to pull the latest version of my branch, merge, and commit. Then the git reset --hard {hash} worked on the server I was running the command on.

like image 42
Justin Avatar answered Oct 28 '22 17:10

Justin


Try updating your local repo with

git fetch
like image 5
francojay Avatar answered Oct 28 '22 16:10

francojay