1

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.

1

2 Answers 2

0

You should:

  1. Install heroku CLI plugin
  2. Sign in using command heroku login
  3. Add heroku as remote repository (gheroku git:remote -a YOUR_PROJECT_NAME) Than you can push You can find instructions here https://devcenter.heroku.com/articles/git
1
  • heroku git:remote -a PROJECT_NAME
    – Min ho Kim
    Apr 28, 2022 at 0:08
0

The issue was caused due to your project name used by another developer on heroku remote server. However, you need to change your project name and use the new name to create empty git repository on heroku server by following the command below before you push your project.

For instance, assumed you have changed your project name and is called foodproject-v2-app-launch

Note that your project name must not more than 30 characters on heroku server and must not be capitalize including special symbol except - and numbers.

Now, go to your terminal and 'cd in' to your project directory then run the below code.

Code 1: $ git init

Code 2: $ git add .

Code 3: $ git commit -m "Your Initial or Second commit"

Code 4: $ heroku create

Code 5: $ touch Procfile

Now open your Procfile with editor and add the following code and save it. Code: web: node app.js

Code 6: $ git push heroku master

or

Code 6.1: $ git push heroku main

That should solve the issue mentioned above. Or refer to this article to read more https://devcenter.heroku.com/articles/git

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.