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 Git Basics Getting Started With Git Committing Changes

Kevin Egstorf
Kevin Egstorf
26,590 Points

the git add command is not working in terminal on my mac, what am i doing wrong?

I am working the gitcourse here on treehouse and i want to work along on my own computer instead of on the websites console. i have noticed in the previous console course that the mac terminal doesn't allow all the unix and linux commands, so i did these on the websites console. but i really want to use git on my own computer. the git add isn't working and i am getting the following error "fatal-not-a-git-repository-or-any-of-the-parent-directories-from-git-status", how can i work around this so i can work this course on my own computer?

7 Answers

The README is in your user directory THAT IS BAD. You don't ever want a git repository there.

cd ~/
mv README my_really_cool_project/README
cd my_really_cool_project/
git add -A README

you need to initialize the git repository with git init from within your project directory

Kevin Egstorf
Kevin Egstorf
26,590 Points

hi James,

tnx for your reply, now i have tried the following:

MacBook-Pro:my_really_cool_project kevinegstorf$ git init Reinitialized existing Git repository in /Users/kevinegstorf/my_really_cool_project/.git/ MacBook-Pro:my_really_cool_project kevinegstorf$ git add README fatal: pathspec 'README' did not match any files MacBook-Pro:my_really_cool_project kevinegstorf$

but as you can see it is not working, i am probably doing this wrong. could you elaborate on your get init answer?

Does the file already exist? The file has to exist before it can be added to the repository. git add does not create the file for you.

Kevin Egstorf
Kevin Egstorf
26,590 Points

when i type ls it sits there:

MacBook-Pro:~ $ ls Adobe Illustrator CS6 16.0.0 Final (Eng Jpn) Mac Os X [ChingLiu] Adobe Photoshop Elements 12 Applications Babygrafix Projects Calibre Library Desktop Development Documents Downloads Library Movies Music Pictures Public README Sync angular.js bootstrapAng gitTest my_really_cool_project

anytime! Don't forget to choose best answer :-D