Explore Courses Blog Tutorials Interview Questions
+2 votes
in DevOps and Agile by (19.7k points)

When I try to push my app to Heroku I get this response:

fatal: 'heroku' does not appear to be a git repository

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

I have tried 'heroku keys:add' but still comes up with the same result. I already have an ssh key for my GitHub account.

1 Answer

+1 vote
by (62.9k points)

To add a Heroku app as a Git remote, you need to execute heroku git:remote -a yourapp.

Here is a proper demonstration:

Initialize GIT

 $ cd myapp $ git init $ git add . $ git commit -m "my first commit"

Then create (initialize) heroku app with:

$ heroku create YourAppName

Lastly, add git remote:

$ heroku git:remote -a YourAppName

Now you can safely deploy your app with:

$ git push heroku master

You should wait for some time and see if you don't get any error/interrupt on console while deploying. For details look at heroku article.

Browse Categories