Mac安装Heroku和部署Heroku

2022-04-15  本文已影响0人  不进则退

通过终端安装:

brew install heroku/brew/heroku

如果是苹果M1电脑使用:

arch -arm64 brew install heroku/brew/heroku

登陆

heroku login

查看当前登陆的邮箱

heroku auth:whoami

如果你的项目没有git管理

git init

查看当前所在的分支

git branch

确保处于main分支,如果不是,需要切换到main分支

git checkout main

检查当前是否有uncommitted changes

git status --porcelain

注意git statusgit status --porcelain的区别

git status -sgit status --porcelain 的区别

如果有uncommitted changes

git add .
git commit -m "a description of the changes I made"

有git管理之后,Connect with Heroku

heroku git:remote -a your-apps-name-here

部署

git push heroku main

一旦编译成功,需要添加服务,(Heroku第一个服务免费)

heroku ps:scale web=1

如果后续更改代码,继续部署

git add .
git commit -m "a description of the changes I made"
git push heroku main
上一篇 下一篇

猜你喜欢

热点阅读