简体   繁体   中英

Push to heroku from another local branch

I have 2 branches: 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:

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. 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:

git push heroku-staging develop:master

--force may work, but it's also dangerous.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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