# 配置

# 初始化

# 名字和Email
$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"
# 列出所有配置
$ git config --list
# 检查某一项配置
$ git config user.name

# 换行符

# 提交检出均不转换
$ git config --global core.autocrlf false
# 提交时转换为LF,检出时不转换
$ git config --global core.autocrlf input
# 提交时转换为LF,检出时转换为CRLF
$ git config --global core.autocrlf true
# 拒绝提交包含混合换行符的文件
$ git config --global core.safecrlf true
# 允许提交包含混合换行符的文件
$ git config --global core.safecrlf false
# 提交包含混合换行符的文件时给出警告
$ git config --global core.safecrlf warn

# 代理

$ git config --global http.proxy 'socks5://127.0.0.1:1080'
$ git config --global --unset http.proxy
$ git config --global http.https://github.com.proxy 'socks5://127.0.0.1:1080'
$ git config --global --unset http.https://github.com.proxy

# 别名

$ git config --global alias.st status
$ git config --global alias.co checkout
$ git config --global alias.ci commit
$ git config --global alias.br branch
$ 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"