sanny Sin
sanny Sin

Reputation: 1555

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 [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?

Upvotes: 3

Views: 859

Answers (2)

Ethan Winn
Ethan Winn

Reputation: 1

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.

Upvotes: 0

Nick Kugaevsky
Nick Kugaevsky

Reputation: 2945

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

$ git push -f heroku development:master

Upvotes: 7

Related Questions