当我尝试着将我的应用推向Heroku时,我得到了这样的回应:

fatal: 'heroku' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我尝试过“heroku keys:add”,但仍然得到相同的结果。 我已经有一个ssh密钥为我的GitHub帐户。


当前回答

显示heroku访问的所有应用程序

heroku apps

并检查你的应用程序是否存在 然后

 execute heroku git:remote -a yourapp_exist

其他回答

英雄吉尔:遥控器

我得到了同样的错误,原来我在错误的目录。这是一个简单的错误,所以再次检查你是否在根目录下,然后运行heroku create和heroku git push master。当然,在heroku步骤之前,你必须已经做了git init,就像上面的StickMaNX回答中提到的那样。

我必须以管理员权限运行Windows命令提示符

在我的情况下,我已经登录了,我只是执行了git push。

以下是Heroku官方文章:

初始化GIT

$ cd myapp
$ git init

$ git add .
$ git commit -m "my first commit"

然后创建(初始化)heroku应用程序:

$ heroku create YourAppName

最后添加git远程:

$ heroku git:remote -a YourAppName

现在你可以安全地部署你的应用程序:

$ git push heroku master

您应该等待一段时间,看看在部署时控制台是否没有任何错误/中断。详情请看heroku的文章。