在window10中配置git的公钥
工具/原料
1
window10操作系统
2
已经安装好的git工具
方法/步骤
1
首先去安装好git,如果没有安装好可以去官网下载,下载地址为:https://git-scm.com/downloads
2
安装好后,点击鼠标右键,选中 “Git Bash here
3
打开后的如下所示,输入指令cd ~/.ssh/ 如果提示如果提示 “ No such file or directory' 那么可以采用 命令:mkdir ~/.ssh来创建文件夹
4
配置全局的name和email,这里是你的github的账号和email配置的命令如下:git config --global user.name 'you Account' git config --global user.email 'you email@163.com'
5
生成SSH公钥命令如下:ssh-keygen -t rsa -C “you email@163.com'
6
查看生成的公钥文件命令如下:cd ~/.sshll
7
登陆github网站,点击用户头像旁边的下拉三角形。点击setting。
8
点击左侧的SSH and GPG keys,然后再点击右上方的new SSH Key
9
拷贝id_rsa.pub文件中的所有内容到下图的key区域,粘贴好后点击Add SSH Key
10
测试是否添加成功输入命令:ssh git@github.com 成功后可以看到Hi zhang1github2test! You've successfully authenticated, but GitHub does not provide shell access.Connection to github.com closed.
上一篇:qq飞车中月宝箱怎么获得
下一篇:怎么样把按F3出现搜索的功能去掉