'When I try to push my app to Heroku I get this response:
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.
Solution 1:[1]
You should:
- Install heroku CLI plugin
- Sign in using command heroku login
- 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
Solution 2:[2]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Kirill |
Solution 2 | Younghadiz |