# Heroku ###### tags: `heroku` ```javascript=1 //Login heroku login //在專案中建立Heroku專案,Heroku官網上將建立一個新專案 ,如果沒給專案名稱就會亂數產生 heroku create heroku create "djangogirlsdiary"(專案名稱) //git初始化 git init //git commit... git add . git commit -m "first commit" //設定Deploy的(push)路徑(專案名稱可以在新專案中找到,見下圖一) heroku git:remote -a whispering-headland-01836 //heroku deploy git push heroku master //將舊版Heroku升版為新版本 heroku stack:set heroku-20 -a <app name> //Commit git commit --allow-empty -m "Upgrading to heroku-20" //Redeploy git push heroku master //Heroku app重新命名 heroku apps:rename "$newname" --app "$oldname" //Update git這邊的資料 git remote rm heroku heroku git:remote -a "$newname" //新增Git hub成為新的remote repository git remote add origin https://github.com/timchen1989/runcalculator.git //檢查remote repository git remote -v ``` 圖一 ![](https://i.imgur.com/qBXRMV1.png) 永續Heroku方法 https://uptimerobot.com/dashboard