Skip to content

Latest commit

 

History

History
45 lines (38 loc) · 1.16 KB

Deploy-heroku-cli.md

File metadata and controls

45 lines (38 loc) · 1.16 KB

Deploying with Git ~ heroku

Prerequisites

Initializing a Git repository

cd example-app
git init
git add .
git commit -m "My first commit"

Create a Heroku Remote

heroku create -a example-app
git remote -v
git push heroku main

note : For an Existing App

heroku git:remote -a example-app

Rename a Remote

By default, the Heroku CLI names all of the Heroku remotes it creates for your app heroku. You can rename your remotes with the git remote rename command. For example, rename heroku to heroku-staging:

git remote rename heroku heroku-staging

Deploy From a Branch Besides main

To deploy code to Heroku from a non-main branch of your local repository (for example, testbranch), use the following syntax push it to the remote’s main branch:

git push heroku testbranch:main

Reset a Git Repository

heroku plugins:install heroku-repo
heroku repo:reset --app appname

Referensi