Why can't git resolve the hostname when I push to a valid SSH address?

前端 未结 2 575
情深已故
情深已故 2020-12-18 05:12

I am deploying an app on Heroku so I created a Heroku app from a repo and then did git push heroku master. When I do this it keeps giving me the error:

相关标签:
2条回答
  • 2020-12-18 05:36

    It also be as simple as:

    1. $ heroku login
    2. $ heroku git:clone -a appname ( this line right here solved it for me)
    3. $ git add .
    4. $ git commit -am "make it better"
    5. $ git push heroku master

    after making sure $ heroku git:remote -a appname (has not name conflict between heroku and git)

    0 讨论(0)
  • 2020-12-18 05:56

    git@heroku.com:heroku-app.git is an SCP format for this ssh address.

    It relies on a ~/.ssh/config file with a 'heroku.com' entry, which specify the user, the actual hostname, and if needed, the private/public key path.

    host heroku.com
         user git
         hostname heroku.com
         identityfile ~/.ssh/yourPrivateKey
    

    Again: heroku.com in 'heroku.com:heroku-app.git' is not an hostname: it is an entry in an ssh config file.
    You could replace heroku.com by xxx: git push xxx:heroku-app.git, provided you have an xxx entry in the ~/.ssh/config file.

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