'heroku' does not appear to be a git repository

前端 未结 21 2052
失恋的感觉
失恋的感觉 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 08:56

    If this error pops up, its because there is no remote named Heroku. When you do a Heroku create, if the git remote doesn’t already exist, we automatically create one (assuming you are in a git repo). To view your remotes type in:

    git remote -v”. # For an app called ‘appname’ you will see the following:

    $ git remote -v
    heroku git@heroku.com:appname.git (fetch)
    heroku git@heroku.com:appname.git (push)
    

    If you see a remote for your app, you can just “git push master” and replace with the actual remote name.

    If it’s missing, you can add the remote with the following command:

    git remote add heroku git@heroku.com:appname.git
    

    If you’ve already added a remote called Heroku, you may get an error like this:

    fatal: remote heroku already exists.
    

    so, then remove the existing remote and add it again with the above command:

    git remote rm heroku
    

    Hope this helps…

提交回复
热议问题