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

一世执手 提交于 2019-11-29 07:20:57

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.

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)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!