29

I am new to heroku. I created a very simple rails app, and deployed it to heroku.

how can I commit the changes to git?

Oded Harth
  • 4,367
  • 9
  • 35
  • 62
  • 1
    possible duplicate of [How to ensure my Ruby on Rails app hosted on Heroku is updated with latest code in my GitHub repo?](http://stackoverflow.com/questions/5069554/how-to-ensure-my-ruby-on-rails-app-hosted-on-heroku-is-updated-with-latest-code-i) – Craig Stuntz Mar 02 '11 at 16:17
  • 1
    +1 even though I gave the answer. 4 words was just easier to type thatn find it and link it, sry to the mods :) – Taylor Bird Mar 02 '11 at 16:19

6 Answers6

48

You need to perform:

git add .
git commit -m "updated the header and footer"
git push heroku master
Kevin Sylvestre
  • 37,288
  • 33
  • 152
  • 232
  • when I do this It looks like it reinstalling rails all over again. isnt it a way to updated only the changed files? – Oded Harth Mar 02 '11 at 16:30
  • 4
    this is how heroku works (gems are pushed each time). You can create a slug and push that which will rapid deploy. Heroku has a tip article about this: http://devcenter.heroku.com/articles/slug-compiler – Taylor Bird Mar 02 '11 at 16:45
  • I tried to do this, but I've since renamed the app, so it no longer recognizes the push key. Or maybe there's a different reason for that. I don't know, I've only done this once. – I ate some tau Apr 16 '14 at 08:56
  • But how does heroku know which website/project do you refer to? – munmunbb Jul 07 '17 at 06:27
  • 1
    @munmunbb It is configured as a git remote. If you run `git remote -v` inside your project you'll see something like: `heroku https://git.heroku.com/...` – Kevin Sylvestre Jul 07 '17 at 15:58
5

I hope this would help. Three steps:

git add .    
git commit -m "make changes"    
git push heroku master
JustBaron
  • 2,319
  • 7
  • 25
  • 37
Himang
  • 108
  • 1
  • 10
3

It's just a git push

git push heroku master
Taylor Bird
  • 7,767
  • 1
  • 25
  • 31
0

This was what I did to update mine.. hope it will work for you first yo have to run dis command to check modified files git status Take note of the modified files (it could be a path or just a file name) git add <file name or path> run the above command for all the modified file and then commit git commit -m "your message" and now push git push heroku master

Johntizy
  • 11
  • 2
0

This could be strange but I've got error with git push heroku master. However it worked as below and I've managed to update my app.

git push origin master
Çetin
  • 117
  • 2
  • 6
0

if you are deploying via GitHub then you will have to add,

git push origin master

and then use

git push heroku master
user13549001
  • 11
  • 1
  • 3