3

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 [email protected]
 ! [rejected]        development -> master (non-fast-forward)
error: failed to push some refs to '[email protected]'
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?

2 Answers 2

7

Yes, you can do it with --force option when pushing to heroku.

$ git push -f heroku development:master

0
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.