由于快速转发,使用git部署到heroku不断遭到拒绝 [英] Deploying to heroku with git keeps getting rejected due to fast-forwards

查看:91
本文介绍了由于快速转发,使用git部署到heroku不断遭到拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  $ heroku jammit:deploy --app XXXXXXXXXXX 
=====编译资产... [确定]
=====提交资产... [确定]
=====完成...
=====为xxxxx-staging部署资产到heroku ...
到git@heroku.com:XXXXXXXX.git
! [被拒绝] master - > master(非快速转发)
错误:未能将某些文件推送到'git@heroku.com:xxx-staging.git'
为防止您丢失历史记录,非快进更新被拒绝
在再次按下之前合并远程更改(例如'git pull')。有关详细信息,请参阅git push --help的快速转发部分的
'注意事项。
[失败]
=====完成...
=====删除已编译的资产... [确定]
=====提交已删除的资产... [确定]
=====完成...
$ git pull
已经是最新的。

任何想法我做错了或应该采取不同的行动,以便不必强迫一个推?



谢谢

解决方案

你推动它,即使有快进提交,它也会推送它。我们在开发Heroku服务器的过程中一直都是这样做的,因为我们都在推送不同的提交(有些比其他提交更落后)。

  git push -f git@heroku.com:picasso-staging.git 

我不使用但是你可能会先用力推,然后再运行jammit任务。或者检查并看看jammit是否支持某种强制推送标志。


I keep getting the following fail with 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.

Any ideas what I'm doing wrong or should be doing differently to allow for pushing without having to force a push?

Thanks

解决方案

Just force the commit every time you push and it will push it even if there are fast-forward commits. We do this in our development Heroku server all the time since we're all pushing different commits (some further behind than others).

git push -f git@heroku.com:picasso-staging.git

I don't use jammit for deploying, but you could probably get away with force pushing first and then running the jammit task second. Or check and see if jammit supports a force push flag of some sort.

这篇关于由于快速转发,使用git部署到heroku不断遭到拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆