cd example-app
git init
git add .
git commit -m "My first commit"
heroku create -a example-app
git remote -v
git push heroku main
note : For an Existing App
heroku git:remote -a example-app
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
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
heroku plugins:install heroku-repo
heroku repo:reset --app appname