1、给本地git配置全局属性user.name、user.email(github 的账号)
git config --global user.name "your name"
git config --global user.email "your_email@youremail.com"
2、在本地创建ssh key(通过github的账号生成ssh key)
ssh-keygen -t rsa -C "your_email@youremail.com"
3、输入上一步github账号对应的密码,成功的话会生成.ssh
文件夹(打印区有路径),进去,打开id_rsa.pub
,复制里面的key
。
4、登录github网站https://github.com/,登录github,用户菜单下选择Settings-->SSH and GPG keys-->New SSH key,将id_rsa.pub中的内容复制粘贴到New SSH key中的key输入框中,设置title后-->Add SSH key完成。
5、验证是否可以与github连接
ssh -T git@github.com
成功后会输出类似消息:Hi tianqixin! You've successfully authenticated, but GitHub does not provide shell access.
6、创建github仓库,用户菜单边上添加菜单New re