推动heroku失败

时间:2012-11-14 09:21:15

标签: ruby-on-rails git heroku

我是在Rails中编写的Heroku应用程序的合作者我在尝试推送到临时环境时遇到此错误。我只是应用程序暂存环境的合作者,而不是生产回购。当我尝试git push heroku master时,我收到以下错误:

Hugos-MacBook-Air:app_name hugo$ git push heroku master
To git@heroku.com:app_name-test.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@heroku.com:app_name-test.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again.  See the
'Note about fast-forwards' section of 'git push --help' for details.

我不明白输入git help命令时得到的信息。我已经设置了远程heroku repo,我也登录了。我还将我的ssh密钥添加到了heroku。

heroku  git@heroku.com:app_name-test.git (fetch)
heroku  git@heroku.com:app_name-test.git (push)

以上是heroku回购。这也是我与heroku应用程序关联的回购。 git@github.com:app_name/app_name.git我还没有推到github repo那么这就是我的问题吗?

任何人都可以提供帮助吗?我非常感谢谢谢。

1 个答案:

答案 0 :(得分:3)

您可以运行git fetch heroku && git merge heroku/master以确保您的本地仓库与heroku上的远程仓库保持同步。