推到了heroku但没有改变app?

我使用以下三个命令将更改推送到现有应用程序,但更改未反映

$ git add . $ git commit -m "changes" # On branch master # Your branch is ahead of 'origin/master' by 2 commits. $ git push heroku master 

我得到:

 To git@heroku.com:sleepy-oasis-7771.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'git@heroku.com:sleepy-oasis-7771.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (eg 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details. 

并且应用程序中没有反映任何更改

你推了! [rejected] ! [rejected] 。 这就是为什么没有变化生效的原因。

如消息所示:

 To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (eg 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details. 

这将引用您在本地计算机或在线上可见的更多文档。 同样,正如消息所示, git pull (及其产生的合并)将解决此问题。

避免此问题的一种方法是使用rebase工作流而不是合并工作流。 在function分支中进行开发,当您准备好合并时,请拉出master,重新设置function分支,重新运行测试套件, 然后进行合并。

另外,请阅读您的错误消息。