使用“git push heroku master”时出现错误

5
我正在使用以下命令将数据推送到Heroku应用程序。
git clone https://git.heroku.com/bigpro.git
cd bigpro
git add .
git commit . -m "my test on commit" 
git push heroku master

当我使用git push heroku master命令时,会出现类似以下的内容。。。
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 open命令,但是出现了一个错误:

▸    ENOTFOUND: getaddrinfo ENOTFOUND api.heroku.com api.heroku.com:443

当我遇到上述错误时,我尝试在终端中使用命令 heroku git:clone -a bigpro 进行更改,并在更改后使用命令 git push heroku master,但是我收到了一个错误信息。

 remote: ! Push rejected to bigpro. remote: To git.heroku.com/bigpro.git ! 
[remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'git.heroku.com/bigpro.git'; 

你需要将Heroku添加为远程仓库。请参考https://dev59.com/SGw15IYBdhLWcg3wCXKJ - iScrE4m
2个回答

2

首先,安装heroku工具包,然后输入heroku login来正确设置您的帐户。

接下来,输入heroku git:clone -a myapp,其中 myapp 是您在Heroku中应用程序的名称。这将为您拉取存储库并正确设置远程。

接下来,按照惯例进行更改。

然后,可以执行 git push heroku master


我已经安装了Heroku工具包。我使用了“heroku git:clone -a bigpro”命令。在进行更改后,我执行了“git push heroku master”命令,但是出现了错误:“remote: ! Push rejected to bigpro. remote: To https://git.heroku.com/bigpro.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/bigpro.git' ”。 - Andrea
请更新问题并附上完整的错误信息。 - Burhan Khalid

1
在我从Heroku克隆了第二份文件后,这种情况发生了。突然间,git push heroku master不能工作了,我会得到和你一样的错误。但是当我尝试 git push origin master时,它可以正常工作。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接