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 trialJames Nelson
23,956 PointsGit commit
I am watching the GIT basics videos and am on the step 'Committing Changes'. Once I have committed and write a message, I press enter however by doing so I am just given a new line. Is there a ctrl * button I should be entering to add my message successfully?
I am using terminal on mac
4 Answers
Casey Clayton
16,708 PointsThe synax of it should be this
git commit -m "Your message here"
Then run a git status and what is highlighted in green is what has been added to the next commit.
James Barnett
39,199 Points>
How do I commit Specific files then?
That's not how git works.
Committing changes via Git is done in 4 basic steps
- add file to be tracked
- make changes to a file
- commit changes
- push commits to repository
If you are still confused I'd suggest you review how git works either by re-watching the video or by checking out the git immersion tutorial.
James Nelson
23,956 PointsAhhh ok. How do I commit Specific files then? Is it git commit 'filename' -m "Your'e message here"
Casey Clayton
16,708 PointsA specific file would be committed like this
git add filenamehere
Then you would run the commit after you have added the files you want. I would keep going with the Git videos on here as all this is covered.
martin Kattam
Courses Plus Student 14,718 PointsWhy is git commit -a -m "Your message here" wrong and git commit -m "Your message here" correct for the challenge task?