设置SSH Key
在注册好github账号后,打开你的电脑桌面上的一个文件夹,这就建立了一个本地工作库,在里面点击鼠标右键,找到你的git bash here-点击开,如图所示:进行下面操作:
输入cd ~/.ssh——回车(看你是否有了ssh key 密钥,有了就备份);

输入ssh-keygen -t rsa -C "your email"——直接回车,之后会让你输入github的账号密码,会出现如图所示结果,跟着上面所指示的路径,在你的电脑中找到该文件,id_rsa文件即是你的私有密钥,id_rsa.pub是共开密钥

打开你的id_rsa.pub文件,复制下里面的内容,然后登录进去你的github;

在右上角账户那里点击头像边上的下拉,出现如图——点击settings进去,找到左侧的SSH Keys,点击,如图;


在点击Add SSH Key,在title处填入任意的标识,在Key部分里面添加刚才复制的id_rsa.pub文件里的内容,点击添加即可;

最后一步了,只需测试一下链接是否正常了,接着输入:ssh -T git@github.com,这时会问是否继续连接,我们输入 yes,这样,我们的git配置就完成了。
网友评论