1.Git配置
查看Git配置:git config --list
设置用户名:git config --global user.name 'vlson';
设置用户邮箱:git config --global user.email 'vlson@***.com';
查看是否成功 git config --list
2.获取Github仓库地址,拉取代码
git clone https://github.com/vlson/***.git
3.如果不想每次提交输入密码,可以在Github上配置SSH keys
#在本地创建SSH key,然后将生成的SSH key文件内容添加到github帐号上去
ssh-keygen -t rsa -C "your_email@example.com"
#系统提示输入文件保存位置等信息,默认连续敲三次回车即可获得定义密码和名字,生成的SSH key文件保存在中~/.ssh/id_rsa.pub
#使用以下命令获取key,复制key
cat ~/.ssh/id_rsa.pub
将获得的key添加到Github上, 输入标题,粘贴ssh key就可以了: