Locked lesson.
About this lesson
Exercise files
Download this lesson’s exercise file.
Building a Templated Website - Push Live Code to Heroku.docx60.5 KB
Quick reference
Building a Templated Website - Push Live Code To Heroku
Now that our new Resume app is finished, save your code to git, push it to github, and then push it to Heroku.
When to use
You'll want to save your code to git often, but this was a short project so we can wait till we're finished.
Instructions
Since this is a new project with a new workspace, initialize git again:
git config --global user.name "Your Name"
git config --global user.email "Your Email"
git config --global push.default matching
git config --global alias.co checkout
git init
Then login to github and add your keys if you haven't already:
cat ~/.ssh/id_rsa.pub
Then create a new repository at github.
Save your code in the terminal:
git add .
git commit -am "initial commit"
Then push your code to github.com with the instructions they gave you when you created your repository.
Push Your Code To Heroku
Log in to Heroku from the terminal:
heroku login
Add your SSH keys:
heroku keys:add
Create an App:
heroku create
Rename the index.html file to index.php, then save your code to git again (push to github.com)
Push your code to Heroku:
git push heroku master
Finally, rename your app if you like:
heroku rename ENTER_NAME
Hints & tips
- Be sure to initialize git again since this is a new workspace.
- You probably don't need to add your SSH keys to github again.
- Don't forget to rename index.html to index.php for Heroku.
Lesson notes are only available for subscribers.