#Get Node_js_sample from github
-
fork to your github account,
-
clone to your reposotory and change a name to bitstarter
git clone https://github.com/username/Node_js_sample.git
- Configure remotes
cd bitstarter
git remote add upstream https://github.com/username/bitstarter.git
git fetch upstream
#Configure heroku
- Check you heroku accounts, keys (also refer to https://github.com/ddollar/heroku-accounts)
heroku accounts
heroku keys(if there is mulitple keys for one account, run $ heroku keys:remove [email protected])
-
login your heroku account heroku login
-
How to generate new RSA-new Key and add it to Heroku:
First: ssh-keygen -t rsa -C "giordano.scalzo[at]gmail.com" -f ~/.ssh/id_rsa_heroku
then added to my machine:
ssh-add ~/.ssh/id_rsa_heroku
-Potential problem: "Could not open a connection to your authentication agent." when using ssh-add (ref: https://coderwall.com/p/rdi_wq)
-Reason: ssh-add don't know how to talk with the authentication agent.
-Solution:
- ssh-agent
- eval $(ssh-agent)
and, finally, to Heroku
heroku keys:add ~/.ssh/id_rsa_heroku.pub
- Create a site in heroku heroku create
two sample websites: (main) http://mysterious-savannah-7174.herokuapp.com/
http://frozen-caverns-5064.herokuapp.com/
#Push your code to heroku
- push your github project(where?? brach or master) to heroku(Push commits : git push origin master) git push heroku master
#update your github code and update and then deploy to heroku again
-
edit your web.js file using emacs/vim/nano
-
add to github
git add web.js
- commit your updated file to github(branch??)
git commit -m "Updated web.js"
- redepoly
git push heroku master(if it is ok, you can push commits to your github reposotory: git push origin master)
potential problems: GitHub to Heroku Commit Error
Reason: For some reason your Heroku repo has diverged
Solution:
git fetch heroku
git merge heroku/master
git push heroku master