Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git push heroku master error: Repository not found

I just tried pushing to heroku from github and this happened, anyone know how to fix this?

$ git push heroku master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
like image 709
Matthew W. Avatar asked Aug 27 '13 15:08

Matthew W.


3 Answers

Inside your project folder go into .git/config and look at what (if anything) is defined under the heroku remote.

For example, one of my apps has:

[remote "origin"]
  url = [email protected]:jefflunt/cortex.git
  fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
  remote = origin
  merge = refs/heads/master
[remote "heroku"]
  url = [email protected]:cortex-cedar.git
  fetch = +refs/heads/*:refs/remotes/heroku-cedar/*

...where origin is the github repo, master is the master branch on github, and heroku is the name and path to the repository on heroku.

It's important that (a) you have an entry for heroku because that's what makes your push work, and (b) that it's pointed at the correct path/repo.

To get the path/repo for your project go into you application settings on heroku and it should be listed.

On a side note, these lists of remotes in your .git/config file are what make the aliases that you use on the command line work at all, and the names they are given are simply found in the config file.

like image 193
jefflunt Avatar answered Sep 21 '22 12:09

jefflunt


When I encountered this issue I just deleted this line of code from the .git/config file then I tried repushing to heroku(git push heroku master).

[remote "heroku"]
    url = https://git.heroku.com/dry-bastion-47289.git
    fetch = +refs/heads/*:refs/remotes/heroku/*
like image 27
Stephen Melben Corral Avatar answered Sep 24 '22 12:09

Stephen Melben Corral


For the easy solution remove the existing heroku git repo and recreate it.

git remote rm heroku

and then recreate it

heroku create

and later if you want to rename

heroku rename <name of your app>
like image 30
Abdul Basit Avatar answered Sep 21 '22 12:09

Abdul Basit