问题
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.
回答1:
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.
回答2:
Have you created a git repository? Create it using git init and then commit some files.
http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository
回答3:
Make sure you have followed all the steps in the Installation and setup section of the Rails Tutorial book.
The error message you are getting is indicating that you have missed the git init step.
回答4:
This error comes because you are trying to push the changes from a non-cloned working copy of your git repository. have you initialized git repo on the dir that you are working?? if not so initialize git repo by using git init and then either do a git clone or add a remote by using git remote add origin git@github.com:repourl.git for more detail refer this
回答5:
This error is most likely to occur if you haven't made the directly with git init.
Use git init to make the git directory/folder, it will work.
来源:https://stackoverflow.com/questions/13888972/fatal-not-a-git-repository-or-any-of-the-parent-directories-git