I tried reverting to a previous git commit with:
git revert xxx
I’m now receiving this error as a response:
fatal: bad object xxx
What am I doing wrong? How do I fix this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
[Edit 1, 19 Nov 2016] While this would sometimes indicate repository corruption, it turns out to occur on Windows when some command—usually, another Git in another task—is holding internal files open and locked. In this case, terminating the other task should fix it. Original answer is below.
[Edit 2, 6 May 2020] Suppose
xxxabove resembles, e.g.,b34789c0b0d3b137f0bb516b417bd8d75e0cb305(a raw hash ID). If you got this from cut-and-paste, be sure that it’s for this repository (it’s easy to grab a hash ID from some other repository without realizing it, especially if you have multiple windows open). If you retyped it yourself, be sure there aren’t any typos. If this involves submodules, make sure the submodule is up to date. See the comments on the question and some of the answers, including this one.bad objectwith some hexadecimal number tends to mean that a tag has an invalid reference number in it, but can also occur for a few other strange cases. For instance, if I do a:and change the last character (in this case from 6 to 5) and write that out:
What exactly is the
xxxhere and where did it come from?