1. 配置用户名
git config --global user.name "username"
2. 配置邮箱
git config --global user.email "xxxx@xxxx.xx"
3. 其他配置
# 让 Git 不要管 Windows/Unix 换行符转换的事
git config --global core.autocrlf false
4. 编码配置
# 避免 git gui 中的中文乱码
git config --global gui.encoding utf-8
# 避免 git status 显示的中文文件名乱码
git config --global core.quotepath off
# 让 git 对大小写敏感
git config --global core.ignorecase false
# 配置别名
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
5. ssh key pair 配置
SSH 是建立在应用层和传输层基础上的安全协议,其目的是专为远程登录会话和其他网络服务提供安全性的保障。
SSH 密钥对可以让我们方便的登录到 SSH 服务器,而无需输入密码。
- Windows 上 Git Bash 命令行窗口中输入:ssh-keygen -t rsa -C "xxx@xxx.com"
- 接着一直回车生成 ssh key pair
- ssh-add ~/.ssh/id_rsa #把专用密钥添加到 ssh-agent 的高速缓存中,ssh-agent 能避免这种反复输入私钥的烦恼
- cat ~/.ssh/id_rsa.pub
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。