I had uploaded the nodejs app on heroku it works perfectly but after some days i created a git repository on GitHub and uploaded the source code there but during uploading it shows that some number of files would be changed and after uploading when i see my GitHub repo there it says that files are uploaded 37days ago How this is happening? can anyone explain please I used heroku git integration to deploy app on heroku
1 Answer
First, let me explain how heroku works.
It uses its own git repository to trigger builds and deploys when you push code. You have been pushing code to heroku with git push heroku master, right?
That's only updating code on heroku. (Which is what matters for your live site)
When you push to heroku, it is saving your code in its git repository, so your code is safe, don't sweat about it! But it's nice to see that deploy log trace on your terminal, and that's why I use it.
In order for you to update your code to github, you also have to push your code there!
What the github integration at the heroku dashboard does, is that it lets you trigger deploys on heroku using github, if you activate that, you will push your code to github then heroku then will pull your code FROM github and deploy it.
But that doesn't work the other way around, heroku doesn't update your github repository, it only uses your github repository to update itself in order to deploy new code.
