'heroku' does not appear to be a git repository

前端 未结 21 1948
失恋的感觉
失恋的感觉 2020-12-12 08:47

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 repositor         


        
相关标签:
21条回答
  • 2020-12-12 09:06

    In my case, I was already logged-in and I just executed git push.

    0 讨论(0)
  • 2020-12-12 09:10

    First, make sure you're logged into heroku:

    heroku login 
    

    Enter your credentials.

    It's common to get this error when using a cloned git repo onto a new machine. Even if your heroku credentials are already on the machine, there is no link between the cloned repo and heroku locally yet. To do this, cd into the root dir of the cloned repo and run

    heroku git:remote -a yourapp
    
    0 讨论(0)
  • 2020-12-12 09:11

    You could try the following in your root directory:

    // initialize git for your project, add the changes and perform a commit

    git init
    git add .
    git commit -m "first commit"
    

    // create heroku app and push to heroku

    heroku create
    git push heroku master
    

    Not sure where you are in the process. You also don't need github to deploy on heroku, just git. Hope this helps!

    0 讨论(0)
  • 2020-12-12 09:11

    show all apps heroku have access with

    heroku apps
    

    And check you app exist then

     execute heroku git:remote -a yourapp_exist
    
    0 讨论(0)
  • 2020-12-12 09:12

    I got the same error and it turned out I was in the wrong directory. It's a simple mistake to make so double check that you are in the root and then run heroku create and heroku git push master again. Of course you must have done git init, as mentioned in StickMaNX answer above, already before the heroku steps.

    0 讨论(0)
  • 2020-12-12 09:17

    I encountered the same error making a much more novice mistake: I was typing in Heroku with a capital "H," instead of lowercase.

    I recognize that's certainly not the solution for everyone who encounters this error, but it was in my case.

    0 讨论(0)
提交回复
热议问题