Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'git push heroku master' command returns 'fatal: Could not read from remote repository'

Tags:

heroku

When I type, git push heroku master, I get:

!  No such app as sleepy-headland-6232.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

When I do git remote -v, I get:

heroku  [email protected]:sleepy-headland-6232.git (fetch)
heroku  [email protected]:sleepy-headland-6232.git (push)
origin  [email protected]:fackthisshit/github.git (fetch)
origin  [email protected]:fackthisshit/github.git (push)

Therefore I do git remote add heroku [email protected]:sleepy-headland-6232.git, but then I get fatal: remote heroku already exists.

It's like an infinite loop of girder. How can I get out of this loop?

like image 999
user3027052 Avatar asked Nov 28 '13 10:11

user3027052


1 Answers

You don't need to create a new app, sometimes when you rename the app in Heroku you lose the connection to the remote.

To fix it

Just remove the old heroku remote with:


    git remote rm heroku

and add the new one:


    git remote add heroku [email protected]:name-to-the-new-one

if you don't know the link address, you can get it in heroku dashboard, in the settings of the app. And that's it.

like image 189
Gonzalo S Avatar answered Oct 11 '22 23:10

Gonzalo S