使用git部署到heroku会因快进而被拒绝

AnA*_*ice 27 git ruby-on-rails heroku ruby-on-rails-3

我继续使用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.
Run Code Online (Sandbox Code Playgroud)

任何想法我做错了什么或应该采取不同的做法,以允许推动而不必强迫推?

谢谢

iwa*_*bed 85

只需在每次推送时强制提交,即使存在快速提交,它也会推送它.我们一直在我们的开发Heroku服务器中执行此操作,因为我们都在推送不同的提交(比其他提交稍晚).

git push -f git@heroku.com:picasso-staging.git
Run Code Online (Sandbox Code Playgroud)

我没有使用jammit进行部署,但你可能会先用力推动然后再运行jammit任务.或者检查一下jammit是否支持某种力推旗.


dsm*_*hco 7

git push -f REMOTE BRANCH:master #or just master
Run Code Online (Sandbox Code Playgroud)

强迫它!将REMOTE替换为您的heroku远程名称(git remote -v以查看所有远程控制器).将BRANCH替换为您要推送的分支,或者只将"master"替换为主分支.