命令解析
git config 用来配置git的配置文件,git配置级别有3类:
- 仓库级别 local
- 用户级别 global
- 系统级别 system
git 仓库级别对应的配置文件是当前仓库下的.git/config
git 用户级别对应的配置文件是用户宿主目录下的~/.gitconfig
git系统级别对应的配置文件是系统etc目录下的 /etc/gitconfig
- git config –local -l 查看仓库配置
- git config –global -l 查看用户配置
- git config –system -l 查看系统配置
git config 常用配置选项
- git config -e 编辑配置文件
- git config –local -e 编辑仓库级别配置文件
- git config –global -e 编辑用户级别配置文件
- git config –system -e 编辑系统级别配置文件
git config -f 指定文件路径 操作选项
- git config 添加配置项目
- git config –global user.email “you@example.com”
- git config –global user.name “Your Name”
上面的操作表示添加用户级别的配置信息,也就是说修改用户宿主目录下面的配置文件