Valerie Lee
Valerie Lee

Reputation: 1

git push error on Mac computer

On my Mac computer, when I typed in: git push -u origin master I received the following error message:

fatal: Not a git repository (or any of the parent directories): .git Valeries-MacBook-Air:code valerielee$

How can I correct this error?

Upvotes: 0

Views: 145

Answers (2)

Gnosophilon
Gnosophilon

Reputation: 1369

From the looks of it, you simply created a .git directory (based on the small CLI example you posted above). The correct way to create new git repository (even for existing code) is to issue a git init command first.

The answer given by Chris is of course correct then. At the risk of sounding patronizing, I would also like to recommend that you take a look at some tutorials. Here are two I consider great for my students:

Hope that helps.

Upvotes: 1

Chris Knadler
Chris Knadler

Reputation: 2847

fatal: Not a git repository (or any of the parent directories)

This means your current working directory is not within a git repository.

Change directories to a git repository and then run:

git push -u origin master

Upvotes: 1

Related Questions