1.配置用户名
git config --global user.name "yourname"
2.配置邮箱
git config --global user.email "youremail"
3.编码配置
git config --global gui.encoding utf-8
#避免git gui中的中文乱码
git config --global core.quotepath off
#避免git status显示中文文件乱码
windows上还需要配置:git config --global core.ignorecase false
4.git ssh key pair配置
4.1 ssh-keygen -t rsa -C "youremail"
4.2 然后一路回车,不要输入任何密码,生成ssh key pair
4.3 ssh-add ~/.ssh/id_rsa
(执行ssh-add时出现Could not open a connection to your authentication agent,
则先执行 eval `ssh-agent`,再执行 ssh-add ~/.ssh/id_rsa,
ssh-add -l 查看新加的rsa了 )
4.4 cat ~/.ssh/id_rsa.pub
4.5 填写公钥