简体   繁体   English

从另一个本地分支推送到heroku

[英]Push to heroku from another local branch

I have 2 branches: development, some_other_name. 我有2个分支:development,some_other_name。 I've pushed some_other_name branch which is sub branch of development to heroku, i tested my code and then switched to development, did some code change in dev branch, but when i tried to push it to heroku i got next: 我已经将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.

Which means that i have to merge my some_other_name branch into development. 这意味着我必须将some_other_name分支合并到开发中。 Is there any way to not merge these branches, but push only development instead? 有没有办法不合并这些分支,但只推动开发而不是?

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

$ git push -f heroku development:master

Heroku's recommended approach is to use the localbranch:master format of the command: Heroku推荐的方法是使用命令的localbranch:master格式:

git push heroku-staging develop:master

--force may work, but it's also dangerous. --force可能会起作用,但它也很危险。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM