How to push your local master branch to Heroku when you have already clicked the function branch?

To try out the function branch, I pushed it to the Heroku host (since this is the only branch that it uses for your site), that is, I did:

git push heroku feature-foo:master 

Meanwhile, I made some commits in my local master branch. Now I want to push my local host to Heroku, but I get:

 To git@heroku.com :foo-repo.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to ' git@heroku.com :foo-repo.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Merge the remote changes (eg 'git pull') hint: before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. 

This makes sense, because indeed the Heroku master is indeed located on my feature-foo branch and is thus ahead of the host. But I do not want to pull and merge with Heroku, because it will be the same as merging my feature-foo branch, which I do not want to do. Right now, I just want to push my local master without committing the -foo function. (Indeed, I have already used heroku rollback , so changes to the heroku rollback function are not live on the site.)

How to do it?

+6
source share
2 answers

The answer is simple. Make a push, i.e.

 git push -f heroku master 
+16
source

You can also go to your hero panel sites and roll back to the previous build before pushing the non-branch.

visit dashboard.heroku.com/apps/your-app-goes-here/activity

As soon as you see:

enter image description here Click Roll back to here on the assembly you would like to return to. As soon as you return to the correct assembly, you can click from the wizard without using force.

0
source

All Articles