I am trying to ensure that my Heroku master branch is up to date with my latest commit. Over time I have been pushing to Heroku, however it seems these pushes have been ended up as 'new' branches in Heroku remote, as opposed to being merged with Heroku master branch which is what I would like to have been doing. Here is what git remote show heroku returns:
* remote heroku
Fetch URL: https://[email protected]/HB/hbapp.git
Push URL: https://[email protected]/HB/hbapp.git
HEAD branch: master
Remote branches:
frontend new (next fetch will store in remotes/heroku)
james new (next fetch
jes_fix_duedil_empty_address tracked
master tracked
Local refs configured for 'git push':
james pushes to james (fast-forwardable)
master pushes to master (up to date)
Could you help me to achieve the following please:
- How can I tell the difference between each of the 'new' Heroku remote branches and the remote heroku master branch, something like
git diff heroku frontend..master, but that doesn't work. - How can I merge these new heroku remote branches into master branch and then delete all of these heroku remote branches so that I only have master. Note I have called;
git fetch heroku jes_fix_duedil_empty_addressand I can see that this set that branch from 'new' to 'tracked', but it still has not merged these changes to heroku master branch. - For future how can I
git push heroku masterbut so that the push merges to heroku master as opposed to createing a 'new' heroku remote branch which is what this seems to have been doing previously for me (i.e. I don;t ever want any other Heroku branches apart from Master, all branch merging to master will be done on origin and then origin master pushed to heroku master)?
git remote -v returns:
heroku https://[email protected]/HB/hbapp.git (fetch)
heroku https://[email protected]/HB/hbapp.git (push)
origin https://[email protected]/HB/hbapp.git (fetch)
origin https://[email protected]/HB/hbapp.git (push)
and git br returns:
james
* master
and git push heroku master returns:
Everything up-to-date
when i know that it is not, in the sense that local code is not on heroku master.
Thanks for the help.
1 Answer 1
TLDR : The remote url for heroku is pointing on the bitbucket git repo.
Simply changing the url using git remote set-url heroku https://git.heroku.com/HEROKU_APP.git and pushing again on heroku should deploy the app
Do it locally. When you push a random ( not master ) branch to heroku, it's not deployed and has no real utility. Let say you pushed master:dff52a15 on heroku, you commit some new stuff on master and some other stuff on another branch you'd like to deploy. You can see the diffs locally by doing a simple git diff dff52a15
git push heroku :mybranchwill delete mybranch on heroku, however, there is no need to do so.I think your better option is to do the required merge in a local branch then deploy this branch on heroku by doing a
git push heroku local_branch:masterYou can delete your local_branch afterward
7 Comments
git remote show heroku as above? Thanks Vincent.git push heroku master says all upto date when i'm sure that it is not. Heroku remote branch status as above.