我一直在使用 heroku + git 时遇到以下失败...
$ heroku jammit:deploy --app XXXXXXXXXXX
===== Compiling assets...[OK]
===== Commiting assets...[OK]
===== Done...
===== Deploying assets for xxxxx-staging to heroku...
To git@heroku.com:XXXXXXXX.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@heroku.com:xxx-staging.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.
[FAIL]
===== Done...
===== Deleting compiled assets...[OK]
===== Commiting deleted assets...[OK]
===== Done...
$ git pull
Already up-to-date.
有什么想法我做错了什么或应该采取不同的方式来允许推送而不必强制推送吗?
谢谢
最佳答案
只需在每次推送时强制提交,即使有快进提交,它也会推送它。我们一直在我们的开发 Heroku 服务器中这样做,因为我们都在推送不同的提交(有些比其他的更晚)。
git push -f git@heroku.com:picasso-staging.git
我不使用 jammit 进行部署,但您可能可以先强制推送,然后再运行 jammit 任务。或者检查 jammit 是否支持某种强制推送标志。
关于ruby-on-rails - 由于快进,使用 git 部署到 heroku 不断被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6901446/