How to attach my repo to heroku app

后端 未结 3 546
無奈伤痛
無奈伤痛 2020-12-12 10:47

I create a heroku app and then my machine crashed. I have a new machine. How do I attach my existing app to heroku app. When I visit heroku page the url for my app is like t

相关标签:
3条回答
  • 2020-12-12 11:19

    If you're using the Heroku Toolbelt, the newer syntax is

    heroku git:remote -a project

    See this for more.

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

    If you've heroku toolbelt:

    If you're using the Heroku Toolbelt, the newer syntax is

    heroku git:remote -a project

    See this for more.

    Credits: user101289's solution

    Else if you don't have heroku toolbelt:

    First do this:

    git remote add heroku git@heroku.com:{heroku-app-name}.git
    

    Then do this:

    git push heroku master
    heroku open
    
    0 讨论(0)
  • 2020-12-12 11:25

    If you're using just Git without installing the Heroku Toolbelt, you can also create a new application.

    Login to your account and go to this link

    https://dashboard.heroku.com/apps

    Look at the plus sign on the top right corner then select

    Create new app

    Leave the application name blank to let heroku choose one for you. Let say your heroku app name is new-app-xxxxx, so to test on adding a file in to it you may try the following command:

    git clone https://git.heroku.com/<new-app-xxxxx>.git
    cd <new-app-xxxxx>
    echo "my test file" > test.txt
    git add .
    git commit . -m "my test on commit" 
    git push
    

    Put empty (blank) when the Git prompt for username, and your API Key for the password. You can get your API Key by showing it from the link below.

    https://dashboard.heroku.com/account

    Note: You cannot authenticate with the Heroku HTTP Git endpoint using your Heroku username (email) and password. Use an API key as described here.

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