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 Introduction to Git First Commits First Commits

Git status showing - fatal: Not a git repository.

I follow everything as shown in the video, but my git status isn't working as it supposed to.

1 Answer

Alex Koumparos
seal-mask
.a{fill-rule:evenodd;}techdegree
Alex Koumparos
Python Development Techdegree Student 36,861 Points

Hi Andrew,

It looks like you either didn't create a repository (using git init) or you are not in the same directory as where you created the repository.

I'm not sure if you are using Windows or Mac/Linux. The following commands will work with Unix/Unix-like systems. If you are using Windows, let me know and I'll give you the Windows equivalent.

  1. Check that you are in the directory you think you should be: pwd. You should be inside the directory where you created the git repo (when you typed git init) and not the parent directory.
  2. If you are definitely in the right directory, maybe you didn't create the repo. Check by typing ls -a. You should see .git in the output. If you don't have a .git subdirectory, you don't have a git repo initialised.
  3. If you don't have the repo initialised, type git init.

Hope that helps.

Cheers,

Alex