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

Baishali Chetia
Baishali Chetia
1,149 Points

how to commit and add a message on git?

is this how to commit and add a new message on git? git commit -a -m "Added a mission statement to README"

2 Answers

Ari Misha
Ari Misha
19,323 Points

Hiya there! I always make sure i keep my unstaging and committing separate coz in staging , i've more control over files/changed files and directories.

Thats how you add files to staging

$ git add *

This is how commit with message:

$ git commit -m "Initial Commit"

But both can be done with a single command:

$ git commit -a -m "Initial Commit"
Nicholas Grenwalt
Nicholas Grenwalt
46,626 Points

Yeah, until you are completely comfortable with how git works I'd do it in stages like Ari mentioned. It will help you internalize what each command is really doing. And then you can get into combining the options later.