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
Jen Hamilton9,994 Points
Error in Code Challenge: Staging Our Changes
I'm not able to get past challenge 5 of 6 for this code challenge. I've tried every combination to commit changes, but nothing works:
Challenge: Now let's commit all the changes we made to the staging area.
git commit -a -m "message"
git commit -a
git commit -m prototype.html "message"
That first command should have worked, I don't know what the problem is. Any suggestions?
Andrew McCormick17,730 Points
wow.. just sat there for 5 minutes typing in various -a , -am, -a -m... etc thanks
This is good because I'm currently going through this challenge and stuck thinking the -a was appropriate.
I was stunk there also. Why so many times nobody change it?
The tutorial was a bit unclear on this point...I would agree with others here.
Ken Wilson7,885 Points
This is extremely unclear. It should really be git commit-a based on the question but this comes up incorrect.
TJ Tijerina15,273 Points
Damn... this problem is already 2 years old? Thanks to all here. I was confused that my answer didn't work
sergei zh2,687 Points
Hello, support team of treehouse!! I have same issue, but it looks like entire treehouse company out of the office, don't read any posts and unable to help...
"The correct answer is actually not to use the
-a flag. The question is asking you to commit all of the changes in the staging area, not all of the changes. By default git will only commit changes that have been staged, or added to the staging area (which is what the
git add command does). The
-a flag is a shortcut that will add all of your current changes to the staging area first before running the commit command.
This is a subtle distinction but it's an important one - sometimes you may have changed 15 files but you only want to commit changes to 5 of them (maybe the others just had debug changes, or are related to a separate change that you're working on at the same time). By adding those changes to the staging area first and then committing only what's in the staging area you can make sure that your work stays separated.
Hopefully that helps. Feel free to let me know if I can help out any further." -Tommy Morgan
The correct answer is in the video "The Staging Area". If, people are still unable to figure out the correct answer I will post it in a response.
damn it .... really....