Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Joseph Turner
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Joseph Turner
Full Stack JavaScript Techdegree Graduate 16,794 Points

fatal: bad object HEAD

(on a Mac) I tried to do [git status] within the medals/ directory, however I got the following ominous error message:

treehouse:~/workspace$ cd medals
treehouse:~/workspace/medals$ git status
fatal: bad object HEAD

Tried some things found on Google but no luck. Does anybody else get this error? Any help would be appreciated, thanks!

2 Answers

Your repository is corrupt. That's a pretty rare thing, but it does happen. For a simple course exercise, you should probably just toss it and start over. For more serious projects, there are ways you can find on google that will sometimes allow you to recover. However, it is a reminder that even with git, you still need backups. (Of course, you can use git to send a backup of your repo to somewhere else, like github or gitlab.)

Joseph Turner
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Joseph Turner
Full Stack JavaScript Techdegree Graduate 16,794 Points

Thanks for your response Adrian. I've been using the Treehouse Workspaces. I deleted my "Introduction to Git" workspaces, and reloaded the Workspace from the video, however I get the same error. Am I doing something wrong?

It's hard to say what is going on. But it appears there may be a problem in the git workspace, something to do with file permissions. I have put in a request to customer support to see if they can resolve it. You may want to report your problems as well. Got to the Support tab, and send them an email, or use the provided button. I would suggest you start from the beginning, so do a "git init", etc. Report the problems as soon as they show up. For me, they showed up as soon as I ran git add.

I just went to the Introduction to git video, and created a new workspace. Inside the medals directory, I ran "git init". That worked fine. But I then tried to run "git add bronze.html", and got errors about permissions. Is that what happens to you?

I've had both of these issues as well, and emailed back and forth with support. They told me to try forking the Workspace for the permission issue, but that didn't work, and when I emailed them again they told me, "Thanks for the follow up! Sadly, we in Support are not teachers nor developers, but we're here to aid you with billing, your account and other various matters pertaining to the Treehouse site. This is the perfect type of question to ask on our Community forum. Once you've posted your question on our forum our teachers can then provide assistance and review your code to confirm that's all working as it should. Because you are getting the errors, it does look like the Workspace and console are working as expected." So basically they said to shove off and get help from the community, because they don't care.