0

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:

  1. 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.
  2. 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_address and I can see that this set that branch from 'new' to 'tracked', but it still has not merged these changes to heroku master branch.
  3. For future how can I git push heroku master but 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.

asked Jul 12, 2017 at 9:59

1 Answer 1

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

  1. 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

    1. git push heroku :mybranch will delete mybranch on heroku, however, there is no need to do so.

    2. 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:master You can delete your local_branch afterward

answered Jul 12, 2017 at 10:17
Sign up to request clarification or add additional context in comments.

7 Comments

I believe I have merged locally and my local, and origin, masters are up to date and I want to push these to heroku master, but when i do so via ` git oush heroku master` I am just told that Everything-is-up-to-date, which I can see is not from when I run the app. The only clue I ahve that anything is wrong, apart from the fact that running the live app doesn't show my changes is the result of git remote show heroku as above? Thanks Vincent.
You merged locally on some specific branch ?
Yes I'm on master branch locally, all changes are up to date, as they are also on origin/master. But git push heroku master says all upto date when i'm sure that it is not. Heroku remote branch status as above.
For sanity check i just cloned the heroku source code to double check, indeed the code on heroku master is not up to date with the changes on origin/master.
Just saw that ... your heroku remote is linked with bitbucket, not heroku .. That's the only reason it does not work from the beginning
|

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.