Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools Git Basics Getting Started With Git Git Ready

git status giving error on Mac

I have installed Xcode and when I opened the terminal on my Mac it asked me to run sudo first to agree to the terms. I did that. However, next I got: "fatal: Not a git repository (or any of the parent directories): .git" What can I do to fix this?

In Mac OS Sierra (and probably earlier versions) you need to install the Command Line Utilities for developers. The easiest way to get them (including git) is to type xcode-select --install in terminal and follow the installation process.

3 Answers

oh my goodness, sorry. I googled and found the answer. I'm brand new to Mac and finding myself a little overwhelmed (had to get one for school)...I had to call support just to find out how to "select all" in a folder (apparently you can't, you have to click and drag), which was a little humbling for me.

For anyone else having the same error: After you do git status and agree to the terms, the error is because there is no git repository in your current directory. To get it working all you have to do is "get init" and the files will be set up. You may want to change directories before you do this if you want the git repository in a specific location.

oh my goodness, sorry. I googled and found the answer

I do this about 75 times a day.

Hey Abby!

I have been having this same issue with my Mac. Im installing Xcode now and tried to use the "get init" but I get -bash: get: command not found.

(Update) I have git installed now however I can't get the sudo apt-get command to work on my Macbook v. 10.8.5 Mountain Lion

Any pointers??

Thanks in advance!

Kevin Korte
Kevin Korte
28,110 Points

Glad to hear you got it figured out. In regards to select all in a folder, try Command than a as a keyboard shortcut.

OMG why didn't the tech at Apple know this???!?

..I mean, thank you :D

Kevin Korte
Kevin Korte
28,110 Points

I don't know. Makes you wonder right? You're welcome!

Kei, xcode is the app you use to write programs but git is separate, you have to install it also. After it's installed then you git init in the directory where you will be working with it.

Ohhh, now I "git" it. :) Thanks for the help!