1

I already run the following codes and everything went smoothly:

git init
git add .
git commit —m 'name'
heroku create

But when I run this code:

git push heroku master

I get this error:

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.
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Please learn some Git basics before. Do you know what you are doing when you run those commands? – Geno Chen Mar 11 '19 at 04:37
  • Though I didn't use Heroku, but I guess there is nothing like `git remote add` inside `heroku create`. Then the reference of "heroku" in `git push heroku master` is empty. – Geno Chen Mar 11 '19 at 04:39

2 Answers2

3

Maybe, as illustrated here, you need one more command before pushing:

cd /path/to/repo
heroku git:remote -a yourapp
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Make sure to do "heroku create" before git push heroku master

Jerry Joseph
  • 101
  • 2
  • 8