Setting up repo on GitHub - Error on push -u origin master

孤街浪徒 提交于 2019-12-03 22:52:36

问题


I'm trying to set up my first Git Repository on GitHub. I've been following the documentation on GitHub's website here. I get everything right up until the very last command: git push -u origin master. It gives me the following error:

FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)
fatal: The remote end hung up unexpectedly

I have no idea what this means. This is the only output I get that differs from what the documentation indicates. I can't seem to find anything online that has this same error and explains what it means and just as importantly what I need to do to fix it. I'm hoping to put up a sweet Java Helper Library, so any help would be greatly appreciated!


回答1:


The error message tells you that you cannot connect properly.

Try logging into GitHub with the following command:

$ ssh -T git@github.com

Maybe you have forgotten to make your SSH key known using ssh-add path/to/key?

To do so, use the following code (which avoids the "Could not open a connection to your authentication agent." problem):

$ exec ssh-agent bash
bash$ ssh-add /path/to/key

See the GitHub docs over at http://help.github.com/ssh-issues/ to resolve the SSH issues.

On Windows, use openssh as "GitHub only provides support for openssh.", it is available here: http://sshwindows.sourceforge.net/



来源:https://stackoverflow.com/questions/10147521/setting-up-repo-on-github-error-on-push-u-origin-master

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