ruby-on-rails - 从另一个本地分支推送到 heroku

标签 ruby-on-rails git heroku

我有 2 个分支:开发、some_other_name。我已经将作为开发子分支的 some_other_name 分支推送到 heroku,我测试了我的代码,然后切换到开发,在 dev 分支中做了一些代码更改,但是当我尝试将它推送到 heroku 时,我得到了下一个:

To git@myapp.git
 ! [rejected]        development -> master (non-fast-forward)
error: failed to push some refs to 'git@myapp.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge the remote changes
hint: (e.g. 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

这意味着我必须将我的 some_other_name 分支 merge 到开发中。有没有办法不 merge 这些分支,而是只 push 开发?

最佳答案

是的,你可以在推送到 heroku 时使用 --force 选项。

$ git push -f heroku development:master

关于ruby-on-rails - 从另一个本地分支推送到 heroku,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15065438/

相关文章:

git - 为什么这个 cherry-pick 有冲突?

ruby-on-rails - 如何在 Rails 3.1 应用程序中拥有唯一的 session ID

ruby-on-rails - 如何清除Rails应用程序中的搜索结果?

ruby-on-rails - 出现 asset not present in asset pipeline 错误后,无法将我的 Rails 应用程序部署到 heroku

git - 在 visual studio online 上托管的 git 中更改远程 HEAD 分支

amazon-web-services - AWS Elastic Beanstalk 无效的二进制包

ruby-on-rails - 添加一个 css 类到 <%= @quest.text %>

windows - OpenSSL SSL_connect : Connection was reset in connection to github. com:443 git windows

python-3.x - heroku python datetime不包括fromisoformat

git - Heroku 从哪里获得 RSA key ?它似乎在 ~/.ssh/以外的地方