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 trialCatherine Brooks
2,799 Pointsgit add won't work
Getting Started with Git, tried to add file README.md using git add, not working.
8 Answers
Sam Roberton
7,225 Pointsgit add README.md
Shani Rivers
14,920 PointsHi Catherine, this is what I do. 1.) Check git status. It should list all the files that changed, or give you an error message if you don't have git initialized (if it isn't, type in git init).
git status
2.) Add the files
git add .
3.) Commit the files.
git commit -am "Updated README.md"
4.) I recheck git status again. It should state that there isn't anything to add. Or you can check the log, it should list the commit message with date, etc. and to exit the log just hit the letter "q" on the keyboard.
git log
commit 8f3ba18a9671511214f72734dfa716f9e7275d23
Author: ninjashanij
Date: Wed Jan 7 09:07:36 2015 -0800
Updated README
commit 70d796000d6ead2b502aed71bf1a96f93cfa3649
Author: ninjashanij
Date: Wed Jan 7 08:42:52 2015 -0800
Initialize repository
Sam Roberton
7,225 PointsNo problem, git commit can be done in slightly different ways.
git commit -am "Commit message for log"
# or
git commit -a -m "Commit message for log"
Since the task before gets you to add the file manually you can forget the -a so...
git commit -m "Commit message for log"
Hope that helps :)
Catherine Brooks
2,799 PointsI swear I typed that and didn't work, copied and pasted your text in and it worked, very frustrating. Now git commit won't work. And Thanks ! I've been going in a circle here.
Catherine Brooks
2,799 Points"We've created a new file in this repository called README.md. Add it to the repository so that git knows to track it." I've tried what you typed, tried a few of my own; i.e., git commit README.md or I've put the README.md in quotes. No luck. I'm not enjoying git very much.
Catherine Brooks
2,799 PointsWell, I finally got it, I put in git commit -a -m READEME.md; I think, can't remember now, I've been going in circles so long, LOL.
Catherine Brooks
2,799 PointsThank you ! I am seeing it takes practice, practice, practice. Hopefully it will sink in. :-)
Shani Rivers
14,920 PointsIt does take practice. I had to write it down on an index card and keep it nearby, until I had it memorized - on the flip-side: once you get it, you'll wonder why you didn't know about it sooner! Happy coding!
Anthony Daniel
1,199 PointsI keep trying nothing is working
MUZ140149 Ordain Gotore
4,644 PointsMUZ140149 Ordain Gotore
4,644 Pointsvery helpful indeed
A X
12,842 PointsA X
12,842 PointsWhy not
git remote add README.md
I know this doesn't work, but I'm not sure why we wouldn't be using remote.