配置
1.等级
注意:每个级别的配置可能会重复或冲突,如果冲突,会以低级别的配置为准,即低级别配置覆盖高级别配置
2.分类
客户端配置
服务端配置
3.读取
介绍
我们可以通过git config命令来设置或读取Git的配置。打开Git Bash Here命令控制台,执行git config命令查看当前配置
命令格式
使用示例
# 查看所有system级别的配置
git config --system --list
# 查看所有global级别的配置
git config --global --list
# 查看所有local级别的配置
git config --local --list
# 查看所有local级别的core.bare配置的信息
git config --local core.bare
# 查看所有级别的core.bare配置的信息
git config core.bare
4.设置
命令格式
使用示例
# 配置system级别user.name配置,如果已经配置将会覆盖
git config --system user.name "季风"
# 清除system级别user.name配置
git config --system --unset user.name
# 配置global级别
git config --global user.name "季风"
# 清空global级别
git config --global --unset user.name
# 配置local级别
git config --local user.name "季风"
# 清空local级别
git config --local --unset user.name