Heroku pushing from wrong branch
My workflow with Heroku has usually been the following:
I keep a 'deploy' branch 开发者_如何转开发locally - this is where I push from. If I need to make a change, I'll branch off of master, (or work in master if it's small), make the change commit to the branch or master, and then checkout deploy. I'll then merge the updated branch into my deploy branch and push from deploy - git push heroku master
Sometime last week, this started breaking down for me. As a test to replicate the issue I did the following
- In my master branch, I removed the logo for the application
- I then commited this change to master branch
- I then checkout deploy
- I never merge with master
- git push heroku master
- Logo disappears on heroku app.
- master and heroku/master are both at the same commit.
This is driving me nuts. This has been my workflow for over a year now, and I've never encountered this problem. Any clues?
What you need to do is have your development branch or branches locally (this may or may not include master). For deploying w/ heroku, you want to have your deploy branch pushed to the remote master on heroku.
git push -u heroku +deploy:master
From now, everytime you want to deploy, all you need to do is
git push heroku
It will only push your deploy branch because that's all you set up to push to the heroku remote.
Hope this helps.
Step 5: git push heroku master
Shouldn't you be doing git push heroku deploy
. Or if you want to push from deploy
in local to master
in heroku
, you must do git push origin HEAD:master
Generally, git push origin master
would push a ref with name master ( mostly refs/heads/master
). If you have to push deploy
you have to use git push origin deploy
or git push origin HEAD
I think deploy and master were same or similar enough that you did not notice this before.
精彩评论