"Error: Multiple apps in git remotes" after web dyno crash on Heroku

Viewed 1212

I'm setting a staging environment following the steps here.

heroku create --remote staging

I checked on the site and a new app was created. Then I attempted to push a specific branch to it:

git push --remote staging  my_branch:master

A build was created and I got a message that it's deployed to the app's URL. But when I went there it displayed an Application Error. The logs report this issue:

Error: Multiple apps in git remotes
  Usage: --remote staging
  or: --app <app_name>
  Your local git repository has more than 1 app referenced in git remotes.
  Because of this, we can't determine which app you want to run this command against.
  Specify the app you want with --app or --remote.
  Heroku remotes in repo:
  <original_app_name> (heroku)
  <new_app_name> (staging)

I tried various combinations of using --remote app_name or --app app_name but I'm getting an unknown option error like this:

error: unknown option `remote'
usage: git push [<options>] [<repository> [<refspec>...]]

What am I missing?

1 Answers

You're confusing git command arguments with heroku ones. git push has no --remote argument; to deploy, just give the remote name on the command-line:

git push staging my_branch:master

I think you actually did that properly since you saw a deploy happen.

Now, the error message you're seeing isn't the application error. It's an error from the heroku CLI logs command telling you that it doesn't know whether it should show logs for your production application or your staging one.

Try

heroku logs --remote staging

or

heroku logs --app <new_app_name>

to see the actual server-side logs that should contain details about your application crash.

Related