Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect to the selected app with heroku CLI

Tags:

git

heroku

I'm attempting to deploy my Java web app on Heroku. When I was making a tutorial I've created an app using heroku create command, lets say it wasy "name-app1". Then I removed it after the tutorial and create the new one to deploy it let it be: "new_app". However, when I attempt to do anything like upload my code there was an error that previous app "name-app1" does not exist anymore. When I try to use for e.g. heroku logs there is following error:

 »   Error: Missing required flag:
 »     -a, --app APP  app to run command against
 »   See more help with --help

I tired to point at my new app with following command:

git remote set-url heroku [email protected]:hidden-ridge-8790.git

I think I messed up something and don't know how to fix it.

like image 706
Luke_Nuke Avatar asked Oct 08 '18 14:10

Luke_Nuke


1 Answers

The way you try to set your remote for heroku is incorrect. That is why you get the above error. To set your remote correctly use the below command

heroku git:remote -a new_app

This will set your remote to newly crated app new_app

To deploy the code use below command

git push heroku master

This will deploy your code to heroku app

like image 150
Azkar Moulana Avatar answered Sep 25 '22 15:09

Azkar Moulana