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

在推送代码之前。

我忘了在运行git push heroku main之前创建一个域名。创建域名解决了这个问题。

遵循以下步骤:

$ heroku login

创建一个新的Git存储库 在新目录或现有目录中初始化git存储库

$ cd my-project/
$ git init
$ heroku git:remote -a appname

部署应用程序 将代码提交到存储库,并使用Git将其部署到Heroku。

$ git add . 
$ git commit -am "make it better"
$ git push heroku master

现有Git存储库 对于现有的存储库,只需添加heroku远程

$ heroku git:remote -a appname

对我来说,答案是在运行heroku create或git push heroku master之前,cd到应用程序的根目录