17

I installed Heroku and set up an account, but for some reason whenever I try to push the app to the site, I get this error.

$ git push heroku master
!  No such app as first_app
fatal: The remote end hung up unexpectedly

I have checked to see that heroku sees the git

$ git remote -v
heroku  git@heroku.com:first_app.git (fetch)
heroku  git@heroku.com:first_app.git (push)

how do I get heroku to recognize my git file?

matt
  • 78,533
  • 8
  • 163
  • 197
Paul
  • 171
  • 1
  • 1
  • 3

7 Answers7

21

It seems that you have renamed your application.

If you have renamed you application just follow the instructions here:

http://devcenter.heroku.com/articles/renaming-apps#updating-git-remotes

Follow: Updating Git remotes part if you updated your application through the Heroku Web Interface!

eagor
  • 9,150
  • 8
  • 47
  • 50
glarkou
  • 7,023
  • 12
  • 68
  • 118
10

If you are using the CLI to rename an app from inside the Git checkout directory, your remote will be updated automatically. If you rename from the website or have other checkouts, such as those belonging to other developers, these will need to be updated manually:

$ git remote rm heroku
$ heroku git:remote -a newname
jbihan
  • 3,053
  • 2
  • 24
  • 34
actraub
  • 123
  • 1
  • 6
9

Here is a step-by-step for first timers to rename your app in git to match it's new heroku name. It also includes slightly different terminal inputs than others have noted here.

  1. open terminal and navigate using

    • cd .. to get back to the main directory and

      cd *dev_folder*/*app_folder* to navigate into the proper folder

    • dev_folder and app_folder will be the actual names of the folders where you file your applications

    • your shell prompt in terminal will now be

      user_name@computer_name:~/dev_folder/app_folder$

  2. remove the current heroku association by typing after the $ prompt:

    git remote rm heroku

  3. open your browser and log into heroku

  4. on heroku click on "MyApps" in the top navigation bar

  5. on heroku click on the application you want to associate with your local directory

  6. on heroku click the "Settings" icon that looks like gears

  7. on heroku scroll down the settings page until you find the "Info" section

  8. on heroku copy your Git URL, git@heroku.com:yourappname.git, from the Info section

  9. go back to your terminal

  10. add your new heroku app name by typing in terminal after the $ prompt:

    git remote add heroku (paste your git url)

    your full prompt will look like:

    user_name@computer_name:~/dev_folder/app_folder$ git remote add heroku git@heroku.com:*yourappname*.git

  11. all done, try to push
knappen
  • 462
  • 3
  • 7
3

It's a common rename problem.

you should go back to heroku and rename your app to the old name

and run the following command to give it a new name from console:

heroku apps:rename new_app_name
Gal Bracha
  • 19,004
  • 11
  • 72
  • 86
2

Try this line to restart en refresh Heroku!

heroku restart
Blazer
  • 14,259
  • 3
  • 30
  • 53
1

Have you created the app on Heroku - via heroku create? Heroku create would setup the heroku git remote to the target repo on heroku.

You can check by going to https://api.heroku.com/myapps and then finding the app in the list if it's already been created. If you may have renamed the application (or to check on the repo URL) click on the app name and it will show you the git repo address. Make sure this matches what you see from doing git remote -v on your local machine.

John Beynon
  • 37,398
  • 8
  • 88
  • 97
0

Try to re-add the remote url.

// Check for the current url 
git remote -v

// remove remote url
git remote rm heroku

// re-add the remote url
git remote add heroku git@heroku.com:boiling-inlet-6951.git
Dharman
  • 30,962
  • 25
  • 85
  • 135
Ashwani Garg
  • 1,479
  • 1
  • 16
  • 22