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

Tyler Dix
Tyler Dix
14,230 Points

"git add README.md" returns "fatal: path spec 'README.md' did not match any files'

I'm usiing Sublime as my text editor if this has anything to do with anything. I'm also in the proper directory in terminal (Mac OS X 10.10.3). Please help.

3 Answers

Tyler Dix
Tyler Dix
14,230 Points

I figured it out. To help other students with this problem, do this:

  1. Open your text editor of choice.
  2. Create a file, and make sure you name it 'README.md' (you can rename the file with the .md file extension after you save it).
  3. Save to your desktop or wherever.
  4. Drag this file to your git repository.
  5. In Terminal (for Mac users) type 'git add README.md'
  6. Type 'ls' to confirm the file has been committed (it should just show up as 'README.md' on the next line in terminal).

Hope this helps. I'm brand new to this so I didn't know I needed to create a file first.

Oliver Sewell
Oliver Sewell
16,108 Points

This helped me thanks Tyler

Tyler Dix
Tyler Dix
14,230 Points

Thanks for the quick response Andrew. I'm only vaguely familiar with terminal commands. Here's what I did:

  1. Created a git repository for my personal website, like mywebsite.com.
  2. Used the "cd" command 'cd mywebsite.com'
  3. Typed "git add README.md'

I'm getting the same fatal message over and over again. I have not specified which text editor I'm using (Sublime), so I'm wondering if this is the issue. Any help is appreciated.

Tyler Dix
Tyler Dix
14,230 Points

The "ls" command returns nada. Just gives me another terminal line to issue a command.

Andrew McCormick
Andrew McCormick
17,730 Points

what's you git config file look like? make sure all paths are correct.

I know you said that you're in the correct directory, but do an 'ls' command and make sure you see the readme file there. Also make sure that it's saved as all caps with lowercase extension just as you are typing it.