Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

https://teamtreehouse.com/forum/git-intro-question-please-help

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