执行 heroku push 时出错

Error while doing heroku push

我在 heroku 帐户中有两个应用程序(比如 A 和 B)。我错误地将“A”应用程序的代码推入了另一个 heroku 应用程序 'B'。然后我只是为 'B' 应用程序做了回滚。

现在,当我尝试将更改推送到 heroku 应用程序 'B' 项目时。

它抛出以下错误。

! [rejected]        master -> master (fetch first)
error: failed to push some refs to  'LINK TO HEROKU APP'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes

现在做什么

如果您完全确定只想将更改从应用程序 B 推送到 heroku,那么您可以添加 -f 标志以强制推送。

警告

请小心,因为这会自动用您推送的内容覆盖您主分支上之前的内容。

看起来像:

git push heroku master -f
git push heroku master -f 

我手动删除了与 'A' 项目无关的所有文件。