-1

I am struggling to understand git & heroku. I have created a nodejs server, pushed it to my github account. I've made a few changes, pulled again, pushed again, and so on.

Now I decide to deploy it to heroku.

Here are herokus instructions:

enter image description here

I have the heroku cli, but I skipped step 2, since I already have everything set up on github (maybe this is what I am doing wrong? am I not supposed to mix heroku & github?). Then comes step 3:

git push heroku master

What exactly does this do? It pushes my repo to heroku? where does this heroku branch come from? And: Do I have to change anything to my normal workflow? Can I just do a normal git push to my repo on github? I am running into errors here constantly, and I think it's because I don't seem to fully understand the workflow / how these things are supposed to work together.

Thanks a lot!

userjmillohara
  • 457
  • 5
  • 25

1 Answers1

0

Ok, so the problem was that I skipped the second step. Especially where it says:

heroku git:remote -a ....

So I had both heroku and github connected, but would only push to heroku - so my github would be behind.

What I should be doing, if I want both connected, is to push to github first, and then do:

git push heroku main / master

After having done this, I do not run into this problem anymore.

userjmillohara
  • 457
  • 5
  • 25