当我尝试着将我的应用推向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帐户。


当前回答

网站简介:

https://dashboard.heroku.com/apps/**<YourAppNameOnHeroku>**/deploy/heroku-git

描述步骤。

其他回答

首先,确保你登录了heroku:

heroku login 

输入您的凭证。

在新机器上使用克隆的git repo时,经常会出现这种错误。即使您的heroku凭据已经在机器上,克隆的repo和heroku之间在本地还没有链接。要做到这一点,cd到克隆的repo的根目录并运行

heroku git:remote -a yourapp

以下是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的文章。

你忘了把你的应用名字和你的heroku链接起来。这是一个很常见的错误。 如果你的应用还没有创建,那么使用:

heroku create (optional app name)

其他:

git add .
git commit -m "heroku commit"

heroku git:remote -a YOUR_APP_NAME

git push heroku master

运行这个

heroku create

在推送代码之前。

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