致命的:不是git存储库(或任何父目录):.git

Sim*_* Yu 19 ruby-on-rails heroku

当我尝试git push to heroku时,我得到了以下内容

fatal: Not a git repository (or any of the parent directories): .git
Run Code Online (Sandbox Code Playgroud)

我试着在轨道教程书上关注ruby.

我想我安装了客户端heroku包(从heroku网站下载并按照他们的指示安装,GUI格式安装).所以我的客户端heroku应该没问题(我是编程新手,所以不确定这个术语的说法是否正确).

然后我打开一个新的终端并键入

git push heroku master
Run Code Online (Sandbox Code Playgroud)

我有

fatal: Not a git repository (or any of the parent directories): .git
Run Code Online (Sandbox Code Playgroud)

谁能擅长这个解释我错过了哪一部分?即必须先移动到某个目录?

请告诉我这个命令,因为如果没有命令我可能仍然不知道.

PS:我想我已经在我的github上有了存储库.

pja*_*mer 9

你不在git存储库目录中.

键入pwd并确保它是您认为应该的位置.你有机会在~/你认为自己所在的目录之前或之前.


Fio*_*a T 9

你有没有创建一个git存储库?使用git init然后提交一些文件来创建它.

http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository


Mr *_*der 5

2020 年 9 月更新

首先,你需要 git repo 来创建一个 heroku 应用程序

git init
git add .
git commit -m "initial commit"
heroku create
git push heroku master

Run Code Online (Sandbox Code Playgroud)

你的代码如何上传到 Heroku