'heroku' does not appear to be a git repository

前端 未结 21 1949
失恋的感觉
失恋的感觉 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:05

    My problem was that I used git (instead of heroku git) to clone the app. Then I had to:

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

    Remember to change MyApp to your app name.

    Then I could proceed:

    git push heroku master
    
    0 讨论(0)
  • 2020-12-12 09:05

    Run this

    heroku create
    

    before pushing your code.

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

    For those who are trying to get heroku to work on codeanywhere IDE:

    heroku login
    git remote add heroku git@heroku.com:MyApp.git
    git push heroku
    
    0 讨论(0)
  • 2020-12-12 09:06

    To add a Heroku app as a Git remote, you need to execute heroku git:remote -a yourapp.

    Source: Deploying with Git

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

    You forgot to link your app name to your heroku. It's a very common mistake. if your app is not created, then use:

    heroku create (optional app name)
    

    else:

    git add .
    git commit -m "heroku commit"
    
    heroku git:remote -a YOUR_APP_NAME
    
    git push heroku master
    
    0 讨论(0)
  • 2020-12-12 09:06

    The following commands will work well for ruby on rails application deployment on heroku if heroku is already installed on developers machine. # indicates a comment

    1. heroku login
    2. heroku create
    3. heroku keys:add #this adds local machines keys to heroku so as to avoid repeated password entry
    4. git push heroku master
    5. heroku rename new-application-name #rename application to the preferred name other than the auto generated heroku name
    0 讨论(0)
提交回复
热议问题