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!

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

General Discussion

git course question

Hi everyone, I'm doing the intro for github so my question is when you have two or more files that you want to commit why is it that you do this with commit -m instead of using commit -a or -am or -a -m or something like that.

-m meaning (message) right ? -a meaning (all) right ? can someone tell me why this is that way or maybe I have missed something.

Thanks in advance

5 Answers

Kevin Niedermayr
Kevin Niedermayr
3,072 Points

Hey Robert,

if you check "git commit -help" it says:

-a, --all             commit all changed files

that means you're right with your assumption. So you just want to push your changed files, which are affected when you hit "git status" and if you add a message via -m you will also push only the changed files (like you would do with -a) so it's not really necessary.

Ok that was helpful thank you for answering

do you think you can help with my oter git post I posted here is the link


If you can help that would be great

Thank you again

Kevin Niedermayr
Kevin Niedermayr
3,072 Points

Maybe, do you have a Link to that video/objective? If I can help you I'll answer it in the other thread and otherwise I'll comment or post here to let you know.

Here's the link http://teamtreehouse.com/library/using-gitflow

thanlks for helping