1.ssh-keygen -t rsa -C "your_email@youremail.com" #创建本地ssh key,your_email@youremail.com为自己的邮箱,之后会提示确认路径和密码,使用默认的一路回车就可以.如果成功则会输出信息:Your public key has been saved in /xx/Users/xxxx/.ssh/id_rsa.pub
2.返回github,进入settings,选择 SSH keys,Add SSH Key,title随便填,粘贴key就完成操作了.
##设置username 和 email后,github每次commit都会记录它们.
git config --global user.name "your name"
git config --global user.email "your_email@youremail.com"