Skip to content

Using Github with Heroku

Gabriele Labanca edited this page Dec 29, 2017 · 7 revisions

Heroku offers an automatic way of deploying apps from Github. This allows to easily manage the code on Github, while deploying only when code is ready.

Cheat sheet

  • push code on Github: git push origin master
  • push code on Heroku (deploy): git push heroku-origin master
  • push code on Github to be automatically deployed on Heroku: git push origin deploy-heroku

Configuration

master branch

images/screenshot_remotes_pre.png

Now rename Heroku remote (here "origin"): git remote rename origin heroku-origin, then check again remotes:

images/screenshot_remotes_post.png

  • add Github remote: git remote add origin https://github.com/green-cani/green_tracker
  • pull git pull origin master

deploy branch

  • create locally a new branch: git checkout -b deploy-heroku, git add -A, git commit -m "create deploy-heroku"
  • push: git push origin deploy-heroku
Clone this wiki locally