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

前端 未结 2 576
情深已故
情深已故 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: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.

提交回复
热议问题