Deploying a Heroku App through Git

STEP 1:

Open the .zip file downloaded from the GbCC convertor on your computer and save the folder on your machine.

STEP 2

Open up the command line (terminal):

STEP 3

Change directories into your application

  • $ cd <path_to_application>

    1. In order to find where your application is, you can copy the path from your documents folder.

  • $ ls

    • Once you’re inside the application, list the contents to ensure you’re in the right location

deploy_1.png

STEP 4

Login to your Heroku account

  • $ heroku login

deploy_2.png

STEP 5

Initialize and push your application to Git

  • $ git init

    1. This creates a local repository for you to add files to

  • $ git add .

    1. This adds all of the folder’s contents to your repository

  • $ git commit -m “initial commit”

    1. This saves your files in their current state to the repository

    2. The message inside the “” can be whatever you want

deploy_3.png

STEP 6

Create your Heroku application

  • $ heroku create

    1. This will create an app folder on Heroku and point your git repository to it

  • If you already have a Heroku app, use the following command:

    1. $ heroku git:remote -a <app_name>

  • $ git remote -v

    1. This will ensure that a Heroku remote has been set for your app

deploy_4.png

STEP 7

Deploying your code

  • $ git push heroku master

    1. This will push all your code to your Heroku remote repository

  • Use the add, commit, and push steps in order to deploy changes for your app

STEP 8

Running your app

  • $ heroku open

    1. This will open up your application in a web browser