Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

repository

I got the following when I try to git push to heroku

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

I try to follow ruby on rail tutorial book.

I think I installed the client heroku package(by downloading from heroku website and follow their instruction to install, GUI format installation). So my client side heroku should be ok (I am new to programming , so not sure if saying by this term is correct or not).

Then I open a new terminal and key in

git push heroku master 

I got

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

Can anyone good at this explain which part I missed? i.e. have to move to some directory first?

Please show me the command since I might still have no idea without command.

PS: I think I have repository in my github already.

like image 320
Simon Yu Avatar asked Dec 15 '12 03:12

Simon Yu


People also ask

How do I fix a fatal Not a Git repository?

Check that you correctly created the repo. If the directory doesn't contain a . git repo, use git init to properly initialize the repo or clone an existing repo. Make sure your HEAD file contains the correct information on your current branch.

What does fatal not a Git repository or any of the parent directories ): .Git mean?

What does “fatal: not a git repository” mean? This error means you attempted to run a Git command, but weren't inside a Git repository. Make sure you've: Navigated to the right directory.

What is .Git folder in Git?

The . git folder contains all information that is necessary for the project and all information relating commits, remote repository address, etc. It also contains a log that stores the commit history. This log can help you to roll back to the desired version of the code.


1 Answers

you aren't on a git repository directory.

type pwd and make sure it's where you think you should be. chances are you are in ~/ or something just before the directory you think you are in.

like image 181
pjammer Avatar answered Sep 18 '22 11:09

pjammer